Skip to main content

Full text of "68 Micro Journal Volume 11 Number 07"

See other formats


Australia A 16.50 
Singapore S $14.95 
Malays* M 114 25 

N»wZa*land NZ J9 95 
MonQKong H S29 00 
Swedan 30 S£K 



0S-9 Systems Integration 

6800 6809 68008 68000 68010 G8020 68030 

The Muganne for Motorola CPU Devices For Over a Decade* 

n,,s,ss " e: OS-9000 p. 6 

A Historical Perspective of the 68000 p.25 

Rave p. 14 

Taming Timing Loops p. 51 

"C" User Notes p. 9 

ihi U4i uucktt m rvta Ffawi ftafaasat, i ntcr*, i:pdji« tic. 

ft ?Jf gr C omfi toar $oumal And Lois More! 

• An in-depth examination of 
the OS-9 design philosophy 

• Detailed discussion of Kernel 
operation and real-time 

Sample file manager and 
driver source listings 

Information on customizing 
your OS-9 system 

An invaluable tutorial for the 
professional programmer 

'This btxik was written for programmers 
who would like to use the advanced fea- 
tures of OS-9. It explains and illustrates 
features of OS-9 ranging from memory 
management through file managers" 

—Peter Dibble 

This is a "must" book for 
all serious OS-9 programmers! 

Use this handy order form 


Address . 




Please send me copy(s) of OS-9 Insights at 

$40.00 each. Add $2.00 shipping and handling for 
each copy ordered, 

TOTAL (includes shipping) $ 

Fill in all the information on this order form. Mail the 
completed order form along with your check, money 
order (no cash, please) or credit card information to; 


l**X) N. W. 1 14th Street • Des Moines, Iowa 50322 

Attention: Order IVnartment 

Or Call: 515-224-1929 

Credit card customers must complete the following 

(Chrck QrttO 

□ MasterCard Q VISA 

Credit Card # 

Expiration Date / 


(Required — Credit Card Customers Onlv) 


Mustan£-020 Mustang-OS Benchmark* 

IBM AT 1300 Xenix S>» 3 

ATatT 7300 UNIX PC 68010 

DEC VAX 1 U 780 UNIX Ocrkkjr 4.2 

PEC VAX 11/750 * * 

68008 05-9«*KSMhi 


MUST ANG-Oi 68009 OS-9 4* t JO Mki 

MUST ANC429 49029 OS9 tSK 16 Mht 


32 bit 















9 JO 






refiner lo«\i t 

for <i*fci< 999999;;***). 

Estimated MIPS . MUSI ANC 020 ^ 4,5 MIPS, 
Bunt to 8 - Iv MJPS: Mol»ru*a Spec* 


OS-9 P*>fe**>ciuJ V«r 


68000 DnuaouiaQ <»/wjua* add: SlOOjOO) 


Mnuvwt tocaJ 



Styld Qr«ph-SpE}|-Me**e 
PAT w/C uuu 
JUST w/C iwno 
Sculpt v» (^ below) 


UnJFLEX <«020 m) 

Scrota £dftx 







X-TAIX (ibc A«0 

Ciwm Asaanblet 

FtfVB 71 

Sc*JpU»* (kc below) 

SuaUnl MUSTANG.020^* •ttippod 12 5 Mh«. 
Add fa 16 6 Mht 68020 
Add r« 164 Mtu 68881 
Add far 20 Mhi 6803W AM 

16 Port cup- RS.2J2 

Resize* I a 2 Adapts Cudi bdow JRS232 Ad*c%? 

Etch wtrdsuppos 4 edditin iM l »cr jhto 

(total dC3& serial porti »«pprtc*J) 

60lircP«ralid VOcard 
Uaoi 3 68230 laalMet/Tmmt ehtpa. 
6 frovp* of ft lizvaaach. »epv%fe buffer 
I To* a 

PttajSype BoAid 

tfojs (or bod dip and PGA device* A ■ 



750 jOO 
500 JOO 
900 jOO 
175 00 
79 J5 
995 jOO 
125 JOO 

1450 00 
300 00 
750 jOO 
100 JOO 
100 jOO 

375 JOO 
750 JOO 

166 00 



faeffsac bcl»acD \*« %y*£*n and 

AROFT modified ufett-puutoc LAN. Tibet o^» opuv»l ■ oil. 

LAN vftwiic driven 120.00 

Exp«u«iforM<*yx*iVOa«iimlM«*til<» $195.00 

Special for cwf>*eta MUSTANG-020 TW >y»*xit buyers • ScuJpUM* 
$69300. SAVE $300.00 
Software OK^idU 

All MU5TANO-02D™ cy™* and toud b*y»» «« , 
d. L< hojiLHMi*U lb<cd n>l\wan: 10 70% <fcjK,id*»$ an aarm Call or 
fri> r« quoa>». DbanilD *y\iy *0e» it» mId *» woll. 






Mustang Specifications 

12 5 Mhx (opiioiial 16.6 Mhz available) MC68020 fall 32-bii wide path 

32 bit wide dm and address buses. noa-muJupleied 

on chip inStruOMst cache 

object code campstibJe with all 68XXX family procaion 

enhanced instruction set • math •ofmxasuar interface 

68881 math hi-specd floating point •o-orooasor (optional) 

direct caunswi of full 68020 in stwetion sei 

full suppou IEEE P754, draft 10.0 

transcend enla) and other scientific math functions 

2 Megabyte of SEP RAM (5 12 * 32 bu organization) 

up to 256K bytes of KPROM (64 * 32 btu) 

4 Asynchronous sent) I/O pons standard 
optional to 20 setial pons 
standard RS-232 interface 
optional netwoik interface 
buffer*! 8 b*i panUel port (1/2 MC68230) 
Centronics typo pinout 
expansion connector for I/O device* 
256 byte addiess space 
2 interrupt inputs 
dock and control signste 
Motorola I/O Channel Module* 
time of day ctocit/ealendar wjbaitciy backup 
eoniraucr for 2. 5 1/4" floppy disk dnves 
single or double side, single or double density 
35 to 80 track selectable (48*96 TPI) 
SASI interface 

programmable pa iodic totenvpt generator 
interrupt, xate fiom micro- seconds lo seconds 
higllly accurate time base PPM) 

5 bit sense switch, readable by the CPU 
Hardware single-step capability 

These hi -speed 68020 syetcma are presently working at NASA. Atomic Energy Commission. 
Government Agencies as well as Universities. Business. Labs, and other Qitical A]iplications 
Centers, worldwide, where speed, math crunching and multiuser, multi-tasking UNIX C level 
V compatibility and low east is a must. 

Don't be mislead! 

ONLY Dota-Comp 

delivers the Super 


Only the "PRO" Version 
of OS-9 Supported! 


For i llmJitd urns we wttl ottsr a $400 irado <n on yourl 
oWftfiXXXSGC. Mull bwwortuno property and ' 

L^ornptote wdh al sottwire, omm And doCum»niala>n . 
0*8 lor rnof* information 

Prke Lisl: 

MuttaAg.020 SBC 


Cabinet w/switching P$ 


5"-80 track floppy DS/DD 

$269 95 

Floppy Cable 


OS^9 68K Professional Version 


C Compiler ($500 Value) 


Winchester Cable 


Winchester Drive 25 Mbyte 


Hard Disk Controller 


Shipping USA UPS 





MC68881 Up math processor 



166? Mhz MC68020 


16.67 Mhi MC6SS8I 


20 Mliz MC6&020 Syi 


Note all 68881 chips work wiih 20 Mhz Sys 




25 Mbyte HD 3329£SH $3749.80 
85 Mbyte HD 3S24&SH $4548.80 

Data-Comp Division 

Note: Only Professional OS-9 Now Available 
(68020 Version) Includes ($500) C Compiler - 
68020 &. 68881 Supported - For UPGRADES 
Wriic or Call for Professional OS-9 Upgrade Kit 

"A Decade of Quality Service" 
Systems World-Wide 
Computer Publishing, Inc. 5900 Cassandra Smith Road 
Telephone (615) 842 4601 - FAX (615) 842-7990 H,Jt50n ' Tn 37343 

68 Micro Journal 

August /September *89 

A Member of the CPI Family 

68 Micro 

10 Years of Dedication to Motorola CPU Users 

The Originator of "DeskTop Publishing™ 

6800 6809 68000 68010 68020 

Don Williams Sr. 

Executive Editor 

Larry Williams 

Production Manager 

Tom Williams 

Office Manager 

Joyce Williams 


Carolyn Williams 

Contributing A Associate Editors 

Ron Anderson 
Ron Voigls 
Doug Luric 

Dr. E.M. "Bud" Pass 
Art Wcllcr 
Dr. Thco Elbert 

Toll Free Subscription Line 1-800 669 6809 

Subscription Rates r r— 

1 Year $ 24.50, 2 years $ 42.50. 3 years $ 64.50 

Canada & Mexico, USA funds 

1 Year $ M.00. 2 Years $ 61.50, 3 Years $ 93.00 

Oiher Countries 

Surface Races , USA funds 

1 Year $ 36.50. 2 Years $ 66.50. 3 Years $ 100.50 

Air Mail Rales, USA funds 
1 Year $ 72.50, 2 Years $ 138.50. 3 Years $ 208.50 


"Over a Decade of Service" 



Computer Publishing Center 

5900 Cassandra Smith Road 

PO Box 849 

Hixson, TN 37343 

Phone (615) 842-4600 FAX (615) 842-7990 
Copyrighted £> 1987 by Computer Publishing, inc. 
68 Micro Journal is the origi naV 'DeskTop Publishing" product 
and has coniinously published since 1978 using only micro- 
computers and special "DeskTop*' software. Using first a kit 
built 6800 micro-computer, a modified ''ball" typewriter, and 
"home grown' 1 DeskTop Publishing soflwaic. None was com- 
mercially available at that time. For over 1 years we have been 
doing "DeskTop Publishing"! We originated what has become 
traditional u DeskTop Publishing"! Today 68 Micro Journal is 
acknowledged as the "Grandfather" of "DeskTop Publishing" 

68 Micro Journal (ISSN 0194-5025) is published 12 times a year 
by Computer Publishing Inc. Second Class Postage paid at 
Hixson, TN. and additional entries. POSTMASTER: send 
address changes to 68 Micro Journal, POB 849, Hixson, TN 

Items or Articles for Publication 

Articles submitted for publication must include authors name, 
address, telephone number, date and a statement that the material 
is original and the property of the author. Articles submitted 
should be ondiskcttc,OS-9,SK*DOS p FLEX, Macintosh or MS- 
DOS. All printed items should be daik type and satisfactory for 
photo-reproduction. No blue inkf No hand written articles - 
please! Diagrams o.k. 

Please - do not format with spaces any text indents, charts, etc. 
(source listing o.k.). We will edit in all formatting. Text should 
fall flush left and use a carriage return only to indicate a 
paragraph end. Please write for free authors guide. 

Letters & Advertising Copy 

Litters to the Editor should be the original copy, signed! Letters 
of grip as well as piaisc arc acceptable. We reserve the right to 
reject any letter or advertising material, for any reason we deem 
advisable. Advertising Rates: Commercial please contact 68 
Micro Journal Advertising Department. Classified advcitising 
must be non-commercial. Minimum of Si 5.50 for first 15 words. 
Add S.60 per word thereafter. No classifieds accepted by tele- 

August /September'69 

68 Micro Journal 

v •«. 

•.■•■•■^L/'-Vr m wW>m/ r :m- : w'wkJ. ' .li>4-=" 

— j. ' .m jj.' ■ ' ^ ■ . CT u-I'li -.- ' r ' - ' -.'.'. ' .M ' . ' .^. . ■ fll ' V.'. 1 . ...a l ..J i.m ■■L ^r /t^T' v 

■'.v. *:••••*■. * * ■ ••• . /•• • • . * '. •• ■ *-. • &•• «*.v.o!**. 



page 14 

page 25 

page 29 

page 51 

OS- 9000 A Technical Overview 

Real-Time Operating System and Development Tools 

1x3 VG By: Tim Harris and Lee Glenn 

A Multi-Media User Interface Package for OS-9/68000 ;":' 

* * i 

The Motorola 68000 Family By: Tom Johnson^ 
A Historical Perspective 

iSmartWare from Microware 
Office Automation Package 

(Taming Timimg Loops By: Peter S. (Jilmour 
A Technique to Control Software Timing Loops 


Columns & Contributions 
;. ...9 : . C User Notes 

32 .' OS9 User Notes 

36 Software User Notes 

42 Forth 

,V. 48 i^» MacAVitfch: * ; #i 

A Tutorial Series Dr E. M. "Bud" Pass 

A Look Back Peter Dibble 

6809 & 68000 Compared Ronald W. Anderson 

A Path Change? R. D. Lurie 

Hyper DA <Sc MuliiCltp , James E. J^ t 

.• % ." * 




66 Micro Journal 

August /September '89 

©IL@©IS ©HIP ©!PH©aJiIL 


From Hit* world's oldest 
& largest OS-SI software house! 


6809/68000-68030 Save 90% 

SCULPTOR-a 4GL - Only from S.E. Media at these prices. OS 9 levels one and two (Ihree GIMIX) 6809, 
ail 68XXX OS-9 standard systems. Regular SCULPTOR versions 1.4:6. One of if nol Ihe most efficient 
and easy lo develope DBMS lype systems running under OS-9. A system of flexible keyed file access that 
allows extremely fast record and dala retrieval, insertion and deletion or olher programmed modifica- 
tions. Access by key or in ascending order, very fast. The system provides automatic menu generation, 
compilation and report generation. Practically unlimited custom input format and report formatting, A 
rich set of maintenance and repair utilities. An extremely efficient development environment that cuts 
most programming approximately 80% in development and debugging! Portable, at source level, to MS- 
DOS, UNIX and many other languages and systems. 

Standard Version: 1.14:6 6809 - $1295.00 

68000 $1295.00 

68020 $1990.00 

Due to a "Special One Time" Purchase, We Are 
Making This Savings Offer. Quantities Limited! 
Once this supply is gone the price goes back up! 
System OS-9: 6809/68000-68030 
• Regular * 1295.00 


$ 99.95 


POB 849 5900 Cassandra Smith Road 

HIXSON, TN 37343 

Telephone(615) 842-4601 FAX (615)842-7990 


August /September '89 

68 Micro Journal 

South "East Media 

OS-9, Vm'fL'EX, flMX, S'K'-DQS 


fax (615) 842-7990 


Full OEM Si Deafer Discounts Available! 


■y.i>tf*jt t nrrtbtrm a puto#rM tuurtfc i*mrt«tt:.*i 


With *vrty ii^vrkjftrnmt f^vtont you i»mm# 

p ftj j grt rtty WMh Sodptw vnu'l ftnd lh#i »+ma wwvl m l*ki 
i wl* h l*Ti hf ac hfnH gi pjU . tn* >nmn 


Sculptor wot iJfMriap«d by ppahaaunaai **o nwtvd * 
ioftwt dtwdc ^ nf tool w*i n ^id H l n »lltMHMl 
H BhMt fc dw in«hrw¥ nimtiit tl ti V r~ *—* - "" ' — ' 
■KM Am, Wh Ipw tm h fr«ft an *wf -tne f ■m^ g Eulanijr 
bat. Sc«t*Mh*b*rr.t#»ft#d»nd»nK«K*dMh*f«rw 
nrMfjftfhriTiariadaptatoat, tail, and abpi* J n ) iWi y 


a<| h l. hi niifi; ilrfli nm l mart— ti i~ 1 *~ 
afq ra— ng lyafefm. axlucftngMS DO& (, W* -Xmi* ami 

i ScWrt IrrfWi L* r. r **>v 

n MtnuMMm 

I iQurry&rArv 

[ i Sift gl laatfy pTfi^im* 


I m. h hk may h*w on# or mom m. • * .t 
typM dl K i4wd ffffctimaytwaa 

™vm* ^waring. M» n/* frwrrnJ j,r*) 
v«M«lli'jnku FWkl PVt* m*y Iw shown 
: tlptunurrvric 





Mt if my irntcrj In Iiiihi mrrniry unit ' 
T inln lKfTfti *i iraagct day ftumtvfi 

VMS frVOlff1*wtadlMt|*MVdhtfih«H Wtflntftjnt 

VTial ptTVjrial MJmpijWrt [Tin 

Lar9t<mmi*ntfm*rrfnflw* ¥ 

«n*ip*rWrw((aittpLH#f* tfwnurtffwb'tMrFiMCTOtUpIt? 


Sculptor for 68020 
GS-9 & 'UniFLEX 


5ci4p*v"» nmh adwrtagt* Yowtand*rtfap*ppkaA*ii 
on a And ah** PC and -vflhn*- any aUnaKm w? if* 

pre^*«-njftlhffn<**laHa*mulBuwT«y»ami Iip 
icfti—a iwlm fm irwuw^wtllw* pwduc**an math * 
n*Wf martutptaci Own «ft *»*■*■ Innhmv*m 

y. UMMI YW*h h*flh «p««d (Wwlcnnwit. (h*f 


v uh a bat artd p*£w*n ftdvanB. M5h™o>** w#*h 
Sculptor "» iHrftHpntr **«i uwiy^pf It nn««»d_lo« 

Bvu«nfl*"mp**c^riijui4tn.*iLHUiv Scu)|** <*n pr>»nE 

MMMi in in mM AutB*l*M*, Iht Anwnr** *™s f MfH"f 
SculpM » »fc#*dy ^ MOlh « own ^f* rartln 


Scutptoi m w n U wra a R free w*.W* *<* 
MchdcMlir Ph ^ vn luc^ aQlna jut^ 
tHrmtwT* iJ fti#iti«wi m*"« fci h* 
rodnl in*o h>w ochrff W» 

Input <l«4*'n*Vt)*vi 


! it 1,1 ! ■ 

Lt*t iwn« fqud n 
Gnat* «utnui*)ii*l in 

;..]feA, A i..i 


□ m fc Hm^ lmodXldtcOor^rv 

O t*uy « w » ea<Wd >o»e 

Unary ir 


r T #fimnal and pnowi notpinainEV 


Mirnmun* k*v- bmjth t b^t 

MiriirrMjm rKwd Inifiti- 3 byln 

Kjkumunt Mda ptf i«M«d 3Z7*i7 
MaKtmumraconltpHnai IhrwaVirt 


I DpAttc Tucurd layMt 

I I fl—ll JWall) 

K. r ■■•■!■.*■' ■. 

I I CTwch 


i' • (Immh 

Ahrr bnguafr and daw livmal 
! I Setup 1«rmin«l ihflf^K 

GS ■ 


I. ! Pa wfarrmri cVfirml rrjQiu Ar.t 


G DllajiT dr pnyamwwr praf—Kf a» 

WMpHwi tonJBhf n 
.' 1 PtMtfriiJ i^tffut lot mpMi ift^*\i •»! 

■ 3 S^rtwlfe^nwutdnpt^alrnulkpk 

-' \ . txtfmm wCiWy niti*» i*ivwi 


Fac*»V *n [«H **h pnnyarm and 
apfraong MiarncMtfiw^i 

' SobfivSnrt 
1 3 IncwpindMU eif Nn i-Hnal fyp* 

MUSTANG^>20 User; - Ask For Your Specie Discount! 





*$ 1,990 $398 $795 PC/XT/AT/MSDOS $695 $139 $299 

MUSTANG-08 *$ 1.295 $259 $495 Call or write for prices on the following systems. 


* For SPKCLL^VLL lX>W SCULPTOR prRes espt^lally for H80?MW«XXX OS-9 Systems - Set* S|kv 
clal \d ihls Issue. Remember^ **When iht^y are jjont 1 I he price* #iws bock up aw allow!" 

... Sculptor Will Run On Over 100 Other Types of Machines ... 
... Call for Pricing ... 

!!! Please Specify Your Make of Computer and Operating System !!! 

• Full Devctopemcni Package 
•• Run Time Only 

••• C Kev F1?« Llbmrv 

F • H.EX, II m UnlFLfcX 
<XD • Cokir OcxnpiiuM- OS.9 
CCP > Cvkr C«m»>uUr FLEX 

South "East Media 

5900 CassatutraSmitfi &f. - tfuyon, ?n. 3 7343 
rtUpftont: (SIS) 842-4600 ?AX (SIS) 842 7990 

*• Shipping •• 

Add 2* U^.A. (mln. S250) 
Vortkgn 5urr*<( Add 5% 
KorcliP Airmail Add 1&% 
Or C>0.D. Shipping On^ 

'OS-> If i TrJtdayark of Mterqajmrc and Motorola- 'FLEX and UpIPLEX ■<"» Tradinui rk« of Tcchpkat Syattfnj CdtiaMlUnli.»?iK*tMW b aTrnlrmar k af Slxr^K Soft w^ re 5 T .t rfn ^ <>if p. 

68 Micro Journal August /September '89 



Technical Overview 

OS-9000 is a modular rcal-iimc op- 
ciaiing sysicm and development environ- 
ment thai runs on the Motorola and Intel 
families of CISC and RISC microproces- 
sors. Featuring a ROMable real-time ker- 
nel, file managers, utility functions and a 
variety of I/O and networking options, OS- 
9000 offers a full suite of development 
tools. These include a UNIX-like "shell 1 * 
user interface, editors, compilers, source- 
level and system-stale debuggers, plus C 
cross development environments for 
UNIX and PC-DOS machines. 

Providing a superset of Micro ware's 
current OS-9 Real-Time Operating Sys- 
tem, OS-9000 has been rewritten i nC (95% 
of ihc kernel, 100% of the development 
tools) to maximize portability. Initially, 
OS-9000 wiU be available for the 68020, 
68030, 68040 and 80386 micro-proces- 
sors. By the firstquartcrof 1990, Microw- 
are plans to add support for Inters 80486, 
aswcllasa variety of RISC processors (be- 
ginning with Motorola* s 88000). Also 
planned for 1990 will be support for ISDN 
and a variety of loosely- and tightly- 
coupled VMEbus multi-processor archi- 

OS-9000 will be the first rcal-timcopcr- 
ating sysicm lo support resident, as well as 
UNIX and PC-DOS cross development for 
both 680X0 and Intel 80386 microproces- 
sors. The resident development capability 
enables designers lo edit, compile and 
debug their code directly on the 80386 or 
680X0 based target hardware. Cross de- 
velopment support, on the other hand, 
enables designers to dcvclopc their real- 
time code on a variety of UNIX and PC- 
DOS host, cross compile, and download 
their code to an 80386 or 680X0-based 

To supplement the basic operating sysicm 
and development environment, Microwarc 
will also offer a broad spectrum of LAN 
and backplane based communicalions op- 
lions, li will also support the RAVE (Real- 
Time Audio/Video Environment) multi- 
media user interface. Combining audio, 
videographics and a customizeablc menu- 
ing sysicm in the same user interface, 
RAVE enables designers to configure real- 
istic man-machine interfaces for real-lime 
industrial and process control systems. 

Scalable Architecture 

One of OS-9000's mosi powerful fea- 
tures is its modular, scalable architecture. 
In OS-9000, all functional components, 
including ihc kernel, file managers, I/O 
drivers and development tools, are imple- 
mented as independent modules. By com- 
bining ihesc modules, designers can realize 
a variety of OS-9000 configurations-from a 
lean, ROMable stand-alone kernel, to a full 
blown multiuser development sysicm. 

In a typical scenario, development is 
handled using a full featured conf iguiation. 
Once the real-time code has been de- 
bugged, the development and I/O modules 
arc stripped away and the kernel is de- 
ployed wilh the application code in ihc 
larget sysicm. All of OS-9000' s modules 
arc ROMable. 

Recently, a number of other real-lime 
kernels vendors have jumped on the 
"modularity" bandwagon. Typically, 
however, these kernels lack flexibility. 
Once designers have selected a configura- 
tion and generated the sysicm, if ihcy want 
lo change ihc configuration and add or 

delete a module, ihcy must recompile and 
i clink the entire system. Because OS-9001 
modules arc position independent (mod- 
ules are referred lo name raihcr than by ab- 
solute address), they may be dynamically 
added or deleted from the sysicm while the 
sysicm is running without requiring recom- 
pilation or relinking. 

A Compact, high-speed kernel 

Because OS-9000 (and its predecessor, 
OS-9) has buili a reputation on comprehen- 
sive development support, it's kcmcWcvcl 
capabilities arc sometimes overlooked. In 
point of fact, OS-9000 includes one of ihc 
most robusi kernels on the market, provid- 
ing features such as: 

o Mixed priority-based, 

prc-cmpiivc real-time and 
lime-shared scheduling modes. 

o Task synchronization and 
process management 
constructs such as pipes, 
events, semaphores, and 

o 18-microsccond worst-case 
interrupt latency. 

o Hierarchical tree structured 

o Written using re-entrant code 
(code that doesn't modify 
itself), thereby enabling the 
sharing of modules among 
processes and a reduction in 
memory requirements. 

o Memory protection through 
support for user and sysicm 
state process permissions. 

o Enhanced memory protection 
by taking advantage of 
standard hardware MMU's 
(Though OS-9000 doesn't 

August /September 89 

bt> Micro journal 

roquiic an MMU to ran 
o Standard C library interface for 
I/O operations (read and write 
calls) improves I/O 
performance and boosts 
application portability. 

One of the most common misconcep- 
tions about OS-9 is that it provides only 
time-sliced task scheduling. Ironically, 
scheduling flexibility is one of OS-9000's 
most unique features. To maximize devel- 
opment efficiency, OS-9000 docs offer a 
time-sliced multitasking scheduling mode. 
However, once designers arc ready to de- 
ploy their application in a target system, 
they can also take advantage of OS-9000 1 s 
real-time priority-based pre-emptive 
scheduling mode. 

There arc a number of stand-alone ker- 
nels that can match or exceed OS-9000*s 
intciTupt latency and context switch per- 
formance. Typically, however, they do so 
by reducing the flexibility of their systems 
calls and omitting system-level functional- 
ity such as memory protection. Context 
switch speed, for example, may be signifi- 
cantly increased by minimizing the context 
that the kernel must save. Interrupt latency, 
similarly, may be improved by offloading 
a variety of functions (such as resolving 
priorities for interrupts that share the same 
vector and informing the kernel that an 
interrupt handler has been entered) nor- 
mally handled by the kernel to interrupt 
service routines. 

The problem with stripping kernel func- 
tionality is that it complicates software 
development and adds overhead to applica- 
tion programsand interrupt handlers. In the 
long run, software developers must recre- 
ate and embed kernel-level functionality in 
their application, thereby degrading the 
system-level performance of their applica- 

Miciowarc's approach to kernel design 
was to evaluate a broad class of real-time 
applications and define OS-9000 T s kernel- 
level functionality in terms of common 
application requirements. The end result is 
a robust kernel that not only simplifies 
application development, but boosts sys- 
tem-level performance. 

Microwarc Systems Corp, 
1900 N.W. U4th Street 

Des Moines, Iowa 50322 
Phone: 515/224-1929 

Development Support 

While kernel vendors continue to scrap 
over simplistic performance benchmarks, 
mounting timc-to-markct pressures arc 
causing system designers to place a heavier 
emphasis on I/O capabilities and develop- 
ment support It is in this regard that OS- 
9000 enjoys its chief advantage over its 
competitors. Development support for OS- 
9000 will include: 

1. FORTRAN, C, and Basic 
optimizing compilers and 
interpreters, all of which 
generate compact, position 
independent, re-entrant. 
ROMablc code. 

2. User interface based on 
UNIX-like, "shell" style 
command interpreter 

3. Shell/Utility Set with over 72 
commands for setting the 
"user" environment using 
functions such redirecting I/O. 
managing time, editing text, 
and monitoring processes. 

4. Source-level debugger (for use 
with C compiler) that includes 
a C expression interpreter, 
on-line help, and support for 
breakpoints, single step, sub 
line skipping, variable 
manipulation, and monitoring 
of stack frame data. 

5. Integrated symbolic debugger 
for the C compiler. 

6. System state debugger. 

7. Editors. 

Unlike most real-time OS vendors, who 
integrate software components from a 
number of vendors, Microwarc designs all 
of iis development tools and languages. As 
a result, we arc able to provide a higher 
level of support for our products. 

Resident, UNIX, and PC-DOS 
Cross Development 

To increase development flexibility, 
Microwarc makes its development tools 
available on resident, as well as UNIX and 
PC-DOS hosts. Unlike most real-time 
kernels, which require a remote host to 
handle their development, OS-9000 sup- 
ports a full suite of development tools on 
the target system (such as an MVME147 
CPU board or a standard 386/PC, etc.). 

Thiscapability notonly reduces the cost 
of the development hardware, since de- 
signers don* t have to purchase a separate 
development system, it simplifies field 
maintenance and upgrades. Once the sys- 
tem is deployed in the field, updates and 
modifications can be performed locally 
without relying on the host. Even in a 
diskless environment, the entire OS-9000 
operating system, together with a C com- 
piler and debugger can be ROMcd, thus al- 
lowing local modifications and rccompila- 

UNIX Cross Development. 

In addition to its resident development 
capability, OS-9000 provides a number of 
remote development options. For design- 
CIS who prefer to handle their development 
on a familiar host such as a UNIX worksta- 
tion or IBM PC, OS-9000 offers the UniBr- 
idgc and PCBridgc C cross development 

UniBridgc is a C cross development 
package that links UNIX development 
hoses with real-time target systems running 
OS-9000. Combining C Cross compilers 
that run under UNIX with a source level de- 
bugger that runs under OS-9000, UniBr- 
idgc links UNIX and OS-9000 via Ethernet 
using the TCP/IP protocol and BSD 4.2 
sockets interface. 

With UniBridgc, designers develop 
their application program under UNIX on a 
9000 cross C compiler. Tlic C compiler 
outputs exec utablc OS-9000 memory mod- 
ules that can be downloaded to the largct 
OS-9000 system via Ethernet, and then 
debugged at the source or symbolic level 

68 Micro Journal 

August /September'89 

under OS-9000 on ihc largct system. Sup- 
port for Remote Login via Telnet and file 
nansfcr via FTP (File Transfer Protocol) 
enables users to access the entire OS-9000 
operating system and debug their applica- 
tion from the UNIX host, 

UniBridge is available for the Digital 
Equipment Coiporation VAX, SUN work- 
stations, Hewlett Packard Scries 300 work- 
stations and Apollo Domain systems, 

PC Cross Development 

While UniBridge supports UNIX cross 
development, PCB ridge pro v ides a compa- 
rable Ccro&s dcvelopmcntcnvironmcnt for 
PC-DOS-bascd machines. As with UniBr- 
idge, progjammers develop and debug 
their application on a PC XT/ AT (or com- 
patible) using the OS-9000 development 
tools and a C cross compiler. It should be 
noted that OS-9000 can run resident on a 

The PCBridgc user interface appears as 
a pop up menu. Users select menu options 
(such as edit, compile, transmit, etc.) with 
cither the kcyboaid or a mouse. Once de- 
signers have completed their application, 
they download it to the OS-9000 target 
system using a high-speed serial link, 

Networking Support 

To suppoit the design of distributed 
architectures, OS-9000 will also support a 
wide range of networking options, OS- 
9000's Internet Support Package (OS- 
9000/)SP), for example, enables a host 
CPU board with integrated LAN hardware 
(Such as Motorola's MVME147, which 
includes the LANCE Ethernet chip set) to 
run the TCP/IP protocol without requiring 
an external communications controller 
board. When equipped with this ROMablc 
software, any OS-9000 based 680X0 host 
can communicate with any other system 
(suchasa UNIX, VMS, or DOS based sys* 
tern) running the TCP/IP protocol 

Initially, OS-9000/1SP will provide 
drivers for the LANCE Ethernet chip set. 
However, the software's device independ- 
ence makes it easy to adapt to a variety of 
network interfaces, from Ethernet and 
ArcNct, to SLDC point-to-point serial 

OS-9000/iSP conforms fully with the 
DARPA Transmission Control Piotocol/ 
lmernetProtocol (TCP/IP). Italsosuppoits 
the DARPA specified File Transfer Proto- 
col (FTP) and TELNET (virtual network 
terminal, also known as remote login). 
These protocols not only enable OS-9000 
useis to access other nodes on the network, 
but enable other nodes to access an OS- 
9000/ISP system as a seivcr An OS-9000/ 
ISP BSD4.3 UNIX socket-style communi- 
cations interface provides the link between 
application programs and the TCP/IP 

Complementing the Internet Support 
Package is an extension to OS-9000's 
Network File System that supports multi- 
processing via RS232C cable, local area 
networks such as Arcnct (Ethernet drivers 
will be available soon), and the VMEbus 
system backplane. Known as OS-9000/ 
NET, this software provides a logical ex- 
tension to the OS-9000 I/O system, ena- 
bling users to access files and devices resi- 
dent on remote systems as if they arc resi- 
dent on the user's own system. 

OS-9000/NET woiks with any periph- 
eral device, including other CPU's, print- 
cis, and mass storage devices. It supports 
all of the functions offered in the standard 
OS-9000 disk file manager, such as creat- 
ing and deleting files and directories, and 
changing working directories, 

Multimedia User Interface 

To simplify the dcvclopmcntof realistic 
man-machine interfaces for real-time in- 
dustrial and process contiol systems, OS- 
9000 will also suppoit RAVE (Real-Time 
Audio/Video Environment). Using 
RAVE, designerscan combine high quality 
audio and video, computer generated 
graphics and customizeablc menus in the 
same user interface.R AVE enables design- 
ers to build custom user interfaces and 
control panels without writing a single line 
of code. All of the indicators, controls and 
menus needed to configure an interface arc 
available as library components that can be 
accessed and combined via RAVE's inter- 
active, menu-driven editor. 

If designers want to add components not 
already available in the library, they can 
build their own library functions. Alterna- 
tively, they can digitize the actual compo- 
nents using a video camera. In eiiher case. 
the component can be modified and refined 
using RAVE's paintbox graphics package, 
and added to the remainder of the display. 

Using RAVE's audio tools, designers 
can also capture, edit and play back audio 
segments. The audio may be input via any 
external source, such as a microphone or 
cassette, or loaded from disk. The com- 
pleted audio can then be combined with the 
video image to complete the man/machine 
interface. The audio quality is limited only 
by the hardware. 

Microwarc offices arc located in Dcs 
Moines, 1A, Santa Clara, CA, Southhamp- 
ton, UK, Marseille, Fiance and Tokyo, 
Japan, with field representatives world- 

For more infojmation, please contact 
Microwarc Systems Corp., 1900 N.W. 
1 14th St. Des Moines. Iowa 50322. Phone 






August /Septomber-89 

68 Micro Journal 

The C Programmers 

Reference Source. 

Always Right On Target! 

( C User Notes 

A Tutorial Series 

By: Dr. E. M. Bud 1 Pass 
1454 Laua Lane N.W. 
Conyers. G A 30207 
404 483-1717/4570 

Computer Systems Consultants 



This chapter presents references to books on algorithm design, a problem with a C program, and an example 
C piogram which replicates its input to its outputs. 


Thomas Kinsman (Eastman Kodak, Department 47, 
Rochester, NY) compiled a bibliography generated by 
a request for reference books on algorithms in general. 
Following are comments by Kinsman, then a summary 
of the bibliography and some quotes about the refer- 

It was amusing that there were several different 
combinations of titles and authors were given for 
"THE Dragon Book". The rumors are not clear as to 
whether the authois (Aho, Hopcroft, Sethi, and Ull- 
man) are married to each other, or are simply joined at 
the waist from birth. You can all speculate about that 
among yourselves. Certainly they have made an im- 
portant contribution to our field. 

People generally mentioned Knuth. However, 
Knuth was frequently mentioned as a lower priority 
choice when priorities were mentioned. Many ex- 
pressed difficulty with the way algorithms were given 
in Knuth. Others suggested that Knuth *s method of 
presentation leads to a better understanding of the 
method of implementation. 

Sedgewich was a popular first choice. However, no 
one mentioned that there is now a second edition of this 

This was not a scientific suivey. Votes weie cast for 
a reference by mentioning it in a positive way. In the 
case where prioritized lists were received, no weights 
were assigned. Titles, Authors, etc... were taken on 
good faith. The existence of references was not 

Some people just responded by mentioning authors. 
Referring to a book as "Smith, and Jones" is not always 
helpful, especially if Smith and Jones are really mar- 
ried to each other and have jointly written several 
books. I did my best to figure out which book was 
intended, without killing myself in the process. 

Some respondents just mentioned titles. Some 
books are so closely related, i.e. the "Numerical Recip- 
ies in..." series, that they were giouped together. 

At any rate, this is just an information source for 
your consideration. Neither I, nor my company, rec- 
ommend any of them. The following sources of infor- 
mation are some you may wish to know about. 

Source: "Algorithms", by Robert Sedgewick 

Votes: 19 

Quotes: "...general purpose..." 

Source: 'The Art of Computer Programming", 

by Donald E. Knuth 

Volume 1: Fundamental Algorithms 

68 NScro Journal 

August /September^ 

Volume 2: Seminumerical Algorithms 

Volume 3: Sorting & Searching 

Votes: 39 

Quotes: "...the last place I go..." 

"... No question. Knuth..." 

Source: "Intro, to Data Structures & Algorithms", 

by Aho, Hopcroft & Ullman 

Votes: 9 

Quotes: "It's a great little book of basic algorithms 

& data structures. Nothing too outrageous. 

My copy is almost worn out." 

Source: Data Structures + Algorithms = Programs, 

by Nicholas Wirth 

Votes: 6 

Quotes: "...slightly easier to read, & includes 

quite a bit of Modula-2 code../' 

"...A notorious book. ..Disgusting..." 

Source: Design & Analysis of Computer Algorithms, 
by Aho, Hopcroft & Ullman 
Votes: 6 

Source: The Theory of Parsing, Translation & Compil- 
ing, by Aho & Ullman 
Votes: 2 

Source: Compiler Design, 

by Hopcroft, Ulmman & Sethi 

Quotes: These are the "dragon" books. <DRAGON> 

Source: Principles of Compiler Design, 

by Aho, Hopcroft & Ullman 

Votes: 4 

Quotes: The "dragon" book. <DRAGON> 

Source: Compiler Design, 

by Aho, Hopcroft & Ullman 

Votes: 3 

Quotes: This is the second Dragon book. <DRAGON> 

Source: Intro, to Formal Languages, Automata The- 
ory, & Computation, by Hopcroft & Ullman 

Source: Handbook of Algorithms & Data Structures, 

byG.H. Gonnet 

Pub: Addison-Wesley, 1984 

Votes: 4 

Quotes: "I often look at [this book). It is useful in itself 
(with code in Pascal and/or C) but also full of refer- 
ences — to 23 textbooks & 683 papers to be exact." 
Source: Writing Efficient Programs, by Bentley 

Source: Programming Pearls* by Bentley 

Source: Numerical Recipes in C, the an of scientific 

computing, Numerical Recipes in FORTRAN, 

the an of scientific computing, Numerical Recipes, 

the an of scientific computing, 

by W.T. Vetterling, S.A. Teukolsky, 

W.H. Press, B.P. Flanneiy 

Pub: Cambridge, Cambridge University Press, 1988. 

Votes: 8 

Quotes: "...It doesn't matter which language, ..." 

"...for numerical stuff..." 

Souice: Structure & Interpretation of Computer Pro* 

grams, by Abelson & Sussman 

Votes: 3 

Quotes: "...for numerical stuff..." 

by: Bender & Orszag 

Quotes: "...for numerical stuff..." 

Source: Artificial Intelligence Programming, by Chap 
niac, Reisbeck, Mcdermott & Meehan 
Quotes:".. .It's not the most fundamental book, but I've 
found [it] to be the book that establishes the leap from 
'Let's Learn Lisp!' to Lisp in the Real World - 
filled with all sorts of ideas, permanently beside my 

Souice: Recursive Techniques in Programming, 

by D.W. Barron 

Pub: New York, 1968: American 

Source: Fundamentals of Data Structures, 

Fundamentals of Data Snuctures in Pascal, 

by Horowitz & Sahni 

Votes: 5 

Quotes: " personal favorite..." 

Source: Principles of Data Structures & Algorithms, 

by Horowitz & Sahni 

Votes: 2 

Quotes: "...for general data structures..." 


August /September'89 

63 Mcro Journal 

Source: Fundamentals of Computer Algorithms, 
by Horowitz & Sahni 

Source: Computers & Intractability: 

A Guide to the Theory of NP-Completeness, 

by Michael R. Garey & David S. Johnson. 

Votes: 2 

Quotes: "...Perhaps not an algorithm catalog in the 

strict sense, but I find it useful in problem solving..." 

Source: Heuristics, by Pearl 

Quotes: "...if the problem is NP complete..." 

Source: How to Solve It by Computer, 

by Dromey R.G 

Pub: Prentice/Hall International Series in Computer 


Source: Combinatorial Optimization: 
Algorithms & Complexity, 
by Christos H. Papadimitiiou & Kenneth Steiglitz 
Quotes: "fairly new but it is full of interesting stuff. 
I looked at several similar ones & bought this." 

Souice: Computer & Job-Shop Scheduling Theory 

by E. G. Coffman, Jr. (Ed.) 

Quotes: "A collection by several recognized people." 

Souice: "Factorization Methods For Discrete 

Sequential Estimation" 

Quotes: "useful for estimation algorithms." 

Source: Data Structures & Network Algorithms, 

by Tarjan 

Quotes: "...for network problems..." 

Source: Graphs & Network Algorithms, by Tarjan 
Quotes: "...for combinatorial algorithms & 
recursive structures..." 

Source: Priciples of Database & KnowledgeBase 
Systems, by Ullman 
Votes: 2 

Source: Implementations of PROLOG, by Campbell 

Source: The Computer Modelling of Mathematical 
Reasoning, by Bundy 

Source: Anatomy of LISP, by Allen 

Source: Natural Language Understanding, by Allen 

Souice: Data Structures, by Reingold & Hansen 

Source: Data Structures, by Standish 

Votes: 2 

Quotes: "...understandable level with good Knuth- 

style specifications. Quite complete also..." 

Source: The Unix Programming Environment, 
by Kemighan & Pike 

Souice: Software Tools, by Kemighan 

Source: Matrix Computations, 

by Holub & Van Loan 

Quotes: "...for numerical analysis..." 

Source: Artificial Intelligence, by Winston 
Quotes: "...for AI work, either of the books by Win- 

Source: LispCraft, by Wilensky 

Source: Computer Algorithms, by Sara Baase 

Source: Lisp, by Winston 

Source: Prolog programming for A I, by Bratko 

Source: Fundamentals of Interactive Computer Graph- 

by Foley & Van Dam 
Votes: 2 
Quotes: "...for graphics stuff..." 

68 Micro Journal 

August /September '89 



Following is a program written by Mike Segal. The 
comment describes a problem with it Can you deter- 
mine the problem without reading ahead to the solution 
below? For those with systems providing lint, the 
problem is much more obvious. 

/* v 

/* Generic adder / multiplier V 

/* V 



This program ia to take two numbera and add them 

For teat data I have the two numbera to be 8 and 40320, 

The solution ahould be 823040 but, using the cc com- 
piler, the aolution waa 823000. 

The 4 waa never output. 

For debugging purposes, Z had inaerted a printf to 
diaplay the value for each digit (now oomnnnted out) . 

When recompiled, the program gave me the correct 

BUT when I removed the print statement, it gave me the 
incorrect aolution. 

Kike Segal 


♦include <atdio.h> 

char *calloc () ; 

typedef struct 


int len; 
char *cray; 





HUH gadd(); 

NEW a, b, c; 

int i, j r k; 

a. len - 5; 

a. cray - (char *)calloc(a.lan * sizeof (char) ) ; 

if (a. cray — HULL) 

(void) printf ("A Null ! \n*) ; 

b.len - 1; 

b.cray - (char *)calloc (b.len * sizeof (char) ) ; 

if (b.cray — NULL) 

(void) print f ( "B Null I \n" ) ; 

c.len - 1; 

c.cray - (char *)calloc (c.len * sizeof (char) ) ; 

if (c.cray — NULL) 

(void) printf ( n C Null !\n*>; 
♦(b.cray) - 8; 

* (a. cray) - 0; 

* (a. cray + 1> - 2; 
* (a. cray + 2) - 3; 
* (a. cray + 3> - 0; 

* (a. cray + 4) - 4; 
c - gadd(b, a); 

(void) printf (""The solution is \n"); 
for (i - 0; i < c.len; i++) 

(void) printf r%d", * (c.cray ♦ i) ) ; 
(void) printf <"\n~>; 


HUM gadd(x, y) 
NUM x, y; 


NUM sum; 

int i, j r k; 

char carry; 

char *spt; 

/* Initalize sum */ 

if (x.len >• y.len) 

sum. len - x.len + 1; 


sum. len - y.len 4- 1; 

sum. cray - (char *)calloc (sum. len * sizeof (char) ) ; 

apt - sum. cray; 

/"* Add loop V 

j - 0; 

carry - 0; 

while ((j < x.len) 1 1 ( j < y.len)) 


♦apt - carry; 

if (j < x.len) 

*spt +- Mx.cray ♦ j); 

if (j < y.len) 

♦apt +■• Mycray + j); 

if (*apt > 9) 

carry - *spt / 10; 


carry - 0; 

*spt %- 10; 

/* (void) printf r\n") ; V 



) /* End of while V 
if {carry) 

*spt - carry; 


August /September'89 

68 Mcro Journal 

return (sum) ; 

) /* End of Generic Adder */ 

The problem ia with the calls to calloc. Although 
malloc requirea one argument (the number of bytea 
requested) , calloc requirea two arguraenta (the number 
of elements and the aize of each element) , Replacing 
the multiply aynibol with a contna in each of the calls 
to calloc cor recta the problem. 

Thia problem illuatratea only one of the inconaiaten- 
ciea in the standard C language library. Prograitmera 
must be very careful and uae whatever toola are 
available, auch aa lint, program beautifiera, etc. 
to prevent errora auch aa thia one from creeping into 
their programs . Since functiona auch aa ma Hoc and 
calloc provide auch aimilar capabilitiea, it ia eaay 
to forget that they have different calling aequencea. 



Following ia thia month' a example C program; it clonea 
ita atandard input to ita standard output and to all 
filea liated on the coimvand line, aimilar to the tee 
command in aeveral popular operating ayatema. 

Note the uae of the f read and f write functiona, rather 
than the getc and putc or aimilar functiona, for per- 
formance reaaona . Charactera are prooeaaed in blocka, 
rather than individually, on each function call, draa- 
tically reducing the average overhead aaaociated with 
each character, 
♦include <atdio.h> 

int w; 

main ( ax gc , axgv ) 
int argc; 
char **argv; 


outfil[0] - atdout; 

for (k - n - 1; (k < axgc) ; ++k) 


if (outfil[n] - fopen(argv(k), "w")) 



(void) f printf (etderr, 

n %a: Cannot open %a\007\n", 
argvtO), argvtk]) ; 


while (w - fread(in, 1, BUFSIZ, atdin) ) 

for (k - 0; (k < n) ; 

(void)fwrite(in, 1, w, outfil(k++] ) ) ; 


for (k - 1; (k < n) ; (void) fcloae(outfil [k+-H ) ) ; 
(void)exit(O) ; 

lifndef BUFSIZ 
♦define BUFSIZ 


lifndef MAXFILE 
♦define MAXFILE 20 

FILE *outfil[*eO(FILE]; 
char in [BUFSIZ]; 
int k; 
int n; 
int t; 




68 licro Journal 

August /September 89 


!A 'Multi-'M.edia Zlser Interface 
Tackagtfor OS -9/68000 

Tim Harris and Lee Glenn 

Microware Systems Corporation 

Des Moines, Iowa 



In recent years, there has been an increase in user interface research and user interface packages for 
computing systems. As these computing systems move more toward the consumer and factory floor, a new 
type of interface is required that is more intuitive and natural for the user. The Real-Time Audio/ Visual 
Environment (RAVE) package for the OS-9/68000 operating system Is a multi-media user Interface 
package designed to meet these goals. With RAVE, developers can quickly create control applications 
which utilize natural images of real world objects and incorporate audio as well as visual feedback. 


In the past several decades, there has been an in- 
creased emphasis on the interface between computers 
and their operators. In the early days of computing, 
this interface was physical; the user interacted with 
the machine via switches. Next came impersonal 
Interfaces; the user fed his data or programs into the 
machine with punch cards or paper tape. The first 
revolution in the human-computer interface was the 
video display terminal. For the first time, an individual 
user could sit down at a terminal and interact directly 
with the computer by typing in commands at the 
keyboard and seeing the results on the display. 

In the mid 1970*s. XEROX Palo Alto Research Cen- 
ter was developing a graphics based user interface In 
which the user could interact with objects on the 
screen In one of several windows. Each window was 
analogous to a piece of paper on a desktop. Along with 
multiple sheets of paper, the useralso had several desk 
"tools" which could be used. 

This window/graphics technology was introduced 
to the public by Apple with the introduction of the 
Macintosh In the early 1980's. The Macintosh was 
designed to be the first computer that could be intui- 
tively used by anyone. It offered a consistent graphics 
interface which was easy to use and learn. 

Today, a graphics/window interface is almost ex- 
pected as standard equipment on home and business 
computer systems. Among the standard offerings are 
Microsoft Windows, the OS/2 Presentation Manager, 
the Amiga Workbench. GEM and X Windows for UNIX 
based systems. 

These new interfaces have had a great impact on the 
efficiency of computing for professional users. These 
systems have also made it easier for non-computer 
professionals to learn how to use a computer. A person 
no longer has to learn dozens of commands with hun- 
dreds of options. Instead, they learn the meaning of 
specific icons and how to manipulate objects in the 
specific environment. 

These interfaces, though much more intuitive com- 
pared to the previous command line interfaces, are still 
hard to use for some people. This is especially true for 
non-computer oriented, illiterate or pre-literate 
people. They are simply overwhelmed by interaction 
with windows and graphic Icons which stand for real 
world objects, but don't look or act exactly like the real 
world object. Development time for applications under 
these interfaces may also be extensive. Programs 
which make use of many menus and objects tend to 
become large and complex. In many cases, there is 
much to learn about the specific Interface before an 
application can be written. 


August /September '89 

68 Mcro Journal 

As more powerful hardware, coupled with high 
quality video and audio, becomes the standard, a user 
interface is required that virtually anyone can use. It 
must be an interface where things look, act and sound 
so much like real objects that the user needs very little 
or no training. 

Along with being extremely user-friendly, the inter- 
face must also be easy to use from the programmer's 
viewpoint. Objects on the display would be best 
handled separately from all other objects. Conse- 
quently, a change in one would not require re-wiiting 
code throughout the program. In fact, it would be best 
If a programmer did not have to write the code for these 
objects at all, but could merely define objects and have 
the coiresponding code automatically generated. 

RAVE (Real-time Audio Visual Environment) from 
Microware Systems Corporation Is such an interface. 
RAVE is a true multi-media user interface designed 
specifically to build objects which look, sound and act 
like their real world counterparts. Not only does RAVE 
give the application a natural looking interface but It 
also gives the programmer or application designer a 
way to interactively build objects and have source code 
generated for them so that little time need be spent in 
actually writing code for the application. 

Microware Systems Corp. 

1900 N.W. 114th Street 

Des Moines, Iowa 50322 

Phone: 515/224-1929 

Western Regional Office 

4401 Great America Parkway 

Santa Clara, California 95054 

Phone: 408/980-0201 

Microware Japan Ltd. 

41-19 Honcho 4-Chome 

Funabashi City 

Chiba 273, Japan 

Phone: 0474 (22) 1747 


The Development of Rave 

Rave and the cd-i environment 

RAVE was developed from Compact Disc Interactive 
(CD-I) technology. In 1986, N.V. Philips of Holland 
and Sony of Japan Joined together to create a new 
standard for optical media. The first true multi-media 
disc would handle computer data, natural image data, 
high quality audio data and have the ability to play all 
of these back in a synchronized manner. This new disc 
format was called CD-I and the standard became 
known as the Green Book* 

When the CD-I specification was first being devel- 
oped. Philips and Sony came to Microware Systems 
Corporation for the operating system to drive these 
new players. This version of the OS-9/68000 operat- 
ing system Is known as CD-RrOS: the Compact Disc 
Real-Time Operating System. Microware became 
closely involved with the CD-I Green Book specifica- 

At the same time. Microware saw the need for a new 
user inteiface for these systems. This user interface 
needed to be usable by a consumer, not a computer 
user. It had to be so Intuitive that ordinary consumers 
and even children could use It with virtually no train- 
ing. It also had to take advantage of the high quality 
audio and natural Image capabilities of the CD-I 

In 1987. Microware began ajolnl development effort 
with Thomson 1SD to develop this new interface. It 
became known as CD -RIDS/RAVE. The philosophy 
behind RAVE development was to create an event 
driven user Interface which would allow developers to 
use natural Images and high quality audio in the Inter- 
active objects on the display. No visual restrictions for 
objects were to be made. For example, a button did not 
have to be a rectangle with text in it. Instead. It could 
be a natural image of a button captured with a video 
cameia. Audio feedback did not have to be a warning 
"beep;** it could be a real voice telling the user what is 


After the Initial development of CD-RrOS/RAVE 
was completed, it was decided that RAVE would be 
useful not only In CD-I systems, but also in the process 
control environment. Current machine front panels 
could be replaced by computer terminals that display 
the same front panel switches, lights and meters. The 
advantage of a software based front panel is that one 

68 Micro Journal 

August / September "89 


display can be used to "run" several different pieces of 
hardware or the layout of the objects on the display 
could be rearranged or altered for better eutciency. 
This would promote a user interface that is easy to 
learn and use for factory floor applications. 

Consequently, a more portable general purpose ver- 
sion of RAVE was created for any OS-9/68000 based 
system. New objects were added to the user interface 
to make it more applicable to the process control envi- 
ronment. A new tool, the OS-9/RAVE Presentation 
Editor, was also added to make development of RAVE 
applications easier and faster. With the new RAVE de- 
velopment tools, a programmer no longer has to do all 
of the work in wrtting and designing an application. 
The programmer writes a minimal amount of code and 
an artist or designer can create and lay out the objects 
to be used on the actual display. 


OS-9/68000 is a modular operating system allow- 
ing vartous types of memory modules to reside in 
memory to build up the software base of the system. 
RAVE takes advantage of this modular nature and is 
built up of several layers of software from the system 
level up to the actual application building software at 
the user level: 

o System Level Software: 

The Graphics File Manager and Drivers 
o Library Level Software: 

The Graphics Support Library 
o Application Design Software: 

The Presentation Editor 








Rave System Level Software 

The Graphics Pile Manager (GFM) 

The highest level of the I/O structure under OS-9 ts 
the file manager module. A file manager is responsible 
for handling the raw data for a class of similar devices. 
For example, the Random Block File Manager handles 
all random access block structured devices such as 
disk drives. For the RAVE environment, the Graphics 
File Manager (GFM) handles all I/O for the multi- 
media devices. These devices consist of video and 
audio output devices and keyboard and pointer input 

GFM has many functions. It directly handles open- 
lng and closing I/O paths to these devices. It dis- 
patches calls to the appropriate devices to handle 
graphics drawing, character input and output.pointer 
input, and audio output. On top of these standard file 
manager duties. GFM also supplies the RAVE environ- 
ment with the support needed for multi-tasking appli- 
cations. This is accomplishes by supplying the appli- 
cation programmer with a construct known as a 
Screen. Screens may be opened for output and can be 
switched under application or user control. Screens 
are the base objects an application must have open to 
display objects on a video device. 

To handle user input for an interactive, event driven 
environment. GFM supplies a facility for generating 
application messages relating to pointer activity on a 
Screen and global changes in the environment. Mes- 
sages are generated by a system state process that 
obtains information from the pointing device and 
builds messages. The messages provide the user with 
specific information, including: 

o the coordinates of the pointer 
o the state of the buttons 
o the time of the message 
o whether the pointer is In any specially defined 
area of the Screen 

Messages are also generated by GFM to notify an 
application that Us Screen is activated or deactivated 
and that the user has changed the system parameters. 

GFM also manages certain "hot spots" on the 
Screen. These hot spots are areas in which the 
application may be especially concerned about a cer- 
tain type of input activity. These hot spots are known 
as Action Regions in RAVE terminology 







August /September 89 

63 Micro Journal 

An Action Region is an arbitrary region of a Screen 
which can be used to filter out messages for the appli- 
cation. For example, there may be a rectangular 
portion of the Screen where a button will be placed. If 
the application wishes to know specifically when the 
pointer button Is depressed within this area. It can 
define this area as an Action Region and ask that only 
"button down" messages be generated for this specific 

Action Regions have various characteristics associ- 
ated with them. They have a size and shape, a cursor 
shape and color used for the graphics cursor when it 
enters the Region, and a set of message masks used to 
filter messages for the Region. There is a basic 
message filter, a message "grabbing" mask and a 
"terminate grab" mask for the Region. When a mes- 
sage in an Action Region matches the "grabbing" mask, 
all new messages generated are "grabbed" by that 
Action Region until the application terminates grab- 
bing directly or until a message that matches the 
"terminate grab" mask is received. 

Action Regions are arranged in a hierarchical tree 
structure. Therefore, an Action Region may have 
a single parent and multiple children. All child Action 
Regions inherit the base characteristics of the parent 
but can be modified. 

GFM has a full set of text functions that allows 
multiple, application defined fonts and various char- 
acter encoding methods. Because RAVE is designed 
for an international market, text encoding is not lim- 
ited to standard 8-bitASCll codes. GFM also supports 
7/15 bit and 16 bit codes to support non-European 
character sets such as JIS Kanjl. In 8 bit character 
mode. GFM contains the full functionality of OS-9's 
standard teiminal file manager, the Sequential Char- 
acter File Manager (SCF). This allows a GFM device to 
be used in teiminal emulation mode in order to run 
standard OS-9 terminal based utilltiessuch as the OS- 
9 Shell. 

The GFM Drivers 

Directly under GFM is a set of device driver modules 
which handle the low level I/O for a specific type of 
hardware. There may be one or more physical devices 
controlled by each driver. For example, a system could 
have two video cards named VvO" and "/v 1" which are 
both managed by the same video driver. The charac- 
teristics of the physical device are kept in a small 
module called a device descriptor which defines the 
address, interrupt vector, interrupt level and other 
parameters for the specific hardware. 

Unlike most OS-9 file managers which communi- 
cate with only one type of device driver. GFM commu- 
nicates with four types of drivers; a video driver, an 
audio driver, a keyboard driver and a pointer dilver. 
GFM ties all of these devices together into a logical 
"multi-media" or "workstation" device. The applica- 
tion program only has to open a path to the main device 
in the chain (usually the video device) and all other de- 
vices are attached and opened for the application by 
the GFM. 

The Video Driver. The most complex of the GFM 
drivers is the video driver. This device driver is respon- 
sible for handling all output to the actual video hard- 
ware. The video driver handles all of the graphics 
drawing, text output and video memoiy allocation. 

Architecture of the Video Driver. The RAVE video 
driver was designed to be easily ported to various types 
of hardware from simple bitmapped hardware to more 
sophisticated graphics co-processors. The video driver 
is built from three distinct code segments: the com- 
mon code, the mode dependent code, and the hard- 
ware dependent code, 

The common code handles the high level constructs 
of the video driver and does all the scan conversion for 
graphics drawing. This is by far the largest portion of 
the driver and comprises about 80% of the code. This 
part of the code usually does not change from driver to 

The mode dependent code is the actual blitter code 
used to combine and move pixels for each general type 
of video. There Is code for 8-bit Color Look Up Table 
(CLUT1 hardware and 4-bit CLIJT hardware. The mode 
code makes up about 10% of the driver code. 

The last 10% of the driver code is made up of 
hardware dependent code. This Is the low-level code 
which must be written for each new video card. The 
hardware dependent code allocates and deallocates 
video memoiy. displays Drawmaps, and sets/gets 
both pixels and CLUT values In the hardware. 

66 Mao Journal 

August /Septembers 


Constructs of the Video Driver. The base con- 
struct of the video driver is the Drawmap. A Drawmap 
Is a pixel map which contains the actual video data for 
a display. A Drawmap Is allocated by the video driver 
and can be linked to a GFM Screen to be displayed on 
the video device. All graphics drawing functions take 
place on a specified Drawmap. Drawmaps can be 
virtually any size, but in order to be linked to a Screen 
and displayed, they must be the size of the actual video 

There are several parameters which may be speci- 
fied to descilbe how pixels will be set in a draw-map: 

o Pattern or non-pattern drawing 

o Pixel mixing mode 

o Solid or Dashed line drawing 

o Pen width and height setting 

o Transparency in drawing 

o Outlined or Filled objects 

The Audio Driver. Ihe RAVE Audio Driver is used 
tohandle allocation of audio Soundmaps and the play- 
ing and recording of Soundmaps. A Soundmap is a 
block of memory which contains sound data for an ap- 
plication to be played through the system's audio de- 
vice. Depending on the hardware, the Audio Driverhas 
entry pointsto allocate, delete, play and record Sound- 

The Pointer Driver. Ihe RAVE Pointer Driver is 
responsible for reporting pointer activity to GFM's 
message handler or directly to the application. The 
pointer device can be a mouse, joystick, trackball, 
lightpen. graphics tablet or touch screen. The only 
requirements are that the device must generate x.y 
coordinates and must have one or more tiiggers that 
can be accessed. 

The Keyboard Driver. The RAVE Keyboard Driver 
handles all input from a keyboard or keypad for the 
application. Keyboard drivers can be written for differ- 
ent types of keyboards; from a full terminal keyboard 
to a small keypad with just a few keys. The keyboard 
driverneeds to be able to read the keyboard and return 
the character code of the key(s) which are depressed. 


On top of the RAVE System Level software is the 
RAVE Library Level software: the Graphics Support 
Libraiy (GSL). GSL is supplied as a linkable C libraiy 
or an OS-9Trap Handler module which can be loaded 
Into memory and shared by several applications run- 
ning at the same time on one copy of the code. GSL 
contains routines to handle higher level objects In the 
RAVE environment. These objects are built from the 
low level Action Regions and Drawmaps and are used 
directly for user interaction. GSL objects are divided 
intofourmajor classes: Requests. Controls. Indicators 
and Overlays. 


A Request is an object used to get user input con- 
cerning a choice to be made among many alternatives. 
In common terms. Requests are used to generate 
menus for the application. GSL Requests can be either 
modal or modeless in nature. 

A modal Request requires input directly before any 
fuither Interaction can take place. Modal Requests 
will stop all other Input on the display until a selection 
(or non-selection) is made. Ihe item number of the se- 
lected item is returned directly to the application to let 
the program know what choice the user has made. An 
example of a modal Request is a pop-up or pull-down 

A modeless Request can remain active on the dis- 
play for an extended period of time. The user can 
repeatedly make selections from it. A modeless Re- 
quest interacts with the application using call-back 
functions. These functions are automatically exe- 
cuted when the user makes a selection from the 
Request. Each Request item can have a corresponding 
call-back function. When the user selects an item In 
the Request, that function is called directly. An 
example of a modeless Request is a standard menu 

GSL supports image based and text based Requests. 
A text based Request Is made up of text strings foreach 
item In the Request. It is similar in nature to most 
menu systems found on popular user Interfaces. GSL 
also supports image based Requests which use differ- 
ent images to show the different states of each item in 
the Request. For example, when the user moves the 
pointer onto an item in the Request, the item may be 
changed by supplying a different image for that state. 
Items may be defined for the disabled, normal, pointer 
on item, and pointer depressed on item states. Audio 
Soundmaps can also be Included for each item in the 


August /September '89 

68 Micro Journal 

Along with the standard Request forms, GSL 
allows the application desij£ier to define custom 
Requests by simply writing a new Request Defini- 
tion Function which describes the Request. 


A Control is an input object that is used to 
simulate real-world push buttons, toggle buttons 
and slide bar type devices. A Control is an linage based 
object: the application designer supplies Images for 
the background of a Control and the various states of 
the Control. A simple push button, for example, ts 
defined by supplying a background image of the button 
and two thumb images for the button: one with the 
button up and one with the button depressed. When 
the user clicks the pointer on the button, the button 
will appearto be depressedjust as a real button would. 
Toggle buttons are handled in a similar manner with 
the application designer supplying different images for 
the different values of a toggle button. A three position 
switch, for example, would be made up of a back- 
ground Image and three separate thumb images for 
each of the three switch positions. Soundmaps may 
also be provided to add sound, when the control is 

Controls communicate input from the user to the 
application using call-back functions. When a Control 
is used, these functions will be directly called to initiate 
the action of the Control. For example, if an applica- 
tion has a slide bar control for audio volume, the call- 
back routine would be responsible for changing the 
volume based on the value of the slide bar Control 
Whenever the user moves the slider, this function will 
be executed and the volume will be changed in real- 

Controls are defined by both their appearance and 
their behavior. These two qualities are controlled by 
two functions known as the Control Definition Func- 
tion and the Control Behavior Function. GSL supplies 
a standard image based Definition Function and two 
behaviorfunctionsforbuttons andsliders. GSL allows 
the application designer to define custom Controls by 
simply writing a new Control Definition and/of Behav- 
ior Function which describes the Control. 


While Requests and Controls provide input objects 
for an application, Indicators provide output objects. 
Indicators ai* used to display a value to the user in one 
of several forms. The following standard Indicators are 
currently supplied with 

o Linear Meters 

o Strip Recorders 

o Level Indicators 

o LCD Indicators 

o Readout Indicators 

An application designer can easOy write a custom 
Indicator Definition Function to define the character- 
istics of a new class of Indicator. 

Indicators, like Controls, are image based objects. 
The application designer supplies a background image 
for each Indicator and specifies the colors to be used for 
any changing part of the Indicator. For example, to 
create linear meter, the application designer would 
supply an image of the meter and a color value for the 
needle of the meter to use for updating its value. 

All Indicators have an application defined range as- 
sociated with them which can contain sub-ranges for 
feedback. For example, a meter may have a total range 
of - 100. with the range of - 20 defined as danger- 
ously low and the range from 80- 100 defined as dan- 
gerously high. An Indicator could be created to moni- 
tor these ranges and automatically play a SoundMap 
and execute a call back function whenever the meter 
moves into or out of the low or high range. 

Miscellaneous Functions 

In addition to supporting the main objects of Re- 
quests, Controls and Indicators, the GSL has several 
other features. One important feature is Overlay 
Windows. An Overlay Window Is a temporary window 
on the Screen which can be used to display error 
messages, dialog boxes or pop-up type menus. An 
Overlay Window can save the area which it obscures. 
The display can then be restored without any applica- 
tion re-painting when the Overlay Window is removed. 
GSL supports several pre-defined frames for Overlay 
windows which Include an outlined frame, a double 
outline frame and a shadowed box frame. Any Re- 
quest. Control or indicator may be placed on and used 
within an Overlay Window. 

GSL also supports a Clipboard device for inter-or 
intra-process data exchange. Data In the Clipboard is 
stored in data modules in memory, but may also be 
written to or read from a novolatile storage device. 
Clipboard data may be ASCII text, pattern data, image 

data nranrtln data 

66 Wcro Journal 

August /September '89 


SL supports a set of Internationalization routines to 
format monetaiy amounts and date strings for the ap- 

the Application design Later 

The OS-9/RAVE Presentation Editor was developed as 
an application designer's tool for implementing the 
features of RAVE In an application as easily and as 
quickly as possible. The Presentation Editor includes 
a rich set of video and audio manipulation tools as well 
as the facility for building GSL objects and generating 
C language source code for them. The Presentation 
Editor is an interactive graphics based application 
built on RAVE, it uses menus and dialog boxes for all 
its work: from showing images to defining the parame- 
ters for a Control. 

Building a RAVE application consists of four steps: 

1 .Capturing or creating video and audio data that will 
be used by the application. 

2. Building the required controls, requests, indi- 
cators and screens with the Presentation Editor. 

3. Writing the application "front end* and call- 
back functions. 

4. Compiling, linking and testing. 

Video Tools 

The Presentation Editor includes tools for the fol- 

o grabbing live video (if the hardware permits) 

o saving and loading the video file 

o importing/exporting to other file foimats 

o cutting and pasting portions of the image 

o resizing 

o adjusting the hue 

o complementing 

o converting to grayscale 

o smoothing 

o mirroring 

o rotating 

A Paint Box facility is provided to allow drawing with 
lines, boxes, arcs, circles and ellipses. Text can also be 
added with the Paint Box tool. 

Audio Tools 

In the audio portion of the Presentation Editor, there 
are tools for capturing live audio (also hardware de- 
pendent), playing an audio file, cutting out a portion of 
the Die. adding silence to a file, and merging two audio 
files together. 

Code Generation Tools 

The code generator can build and generate C source 
code for all GSL objects interactively with a keyboard, 
pointer and video display. When building an object, 
the designer is prompted for all necessaiy data. For ex- 
ample, the designer only has to fill in the blanks for 
items such as the name of the audio file to play when 
a Control is activated or click on check boxes to select 
the various Indicator parameters. The designer is also 
prompted for the name of the call-back function to be 
executed when the object is activated. This call-back 
function and the small "front end" function are all the 
code that the designer will have to write. 
For each object created, a C source iile will be gener- 
ated which includes the definition of that object and 
several routines that act directly upon the object to 
initialize, free, and update or interact with it depend- 
ing upon the class of the object. Each object is a 
separate entity that can be modified without effecting 
any other object in the application. 

After building the objects, the screen builder allows 
the designer to build the screen by adding these 
objects to a background image. The actual location of 
each object is specified by the designer. Objects can be 
added to the screen, moved or deleted until the final 
screen is designed. 

When all source code has been generated, the 
designer must write the application specific code and 
an OS-9 "makefile". The application specific code 
consists of three major sections: 

o initialization code 

o open the video path and initialize the display 

o set up application required color registers 

o initialize the first Screen 

o a message dispatch loop 

o call-back functions for Controls and Requests 

The bulk of the coding to be done by the application 
designer is in the call-back functions. These functions 
must cany out the actions for any Control or Request 
item with which the user is interacting. In many cases, 
the call-back function will simply update another 
object or cause a new 
screen or overlay to be invoked. 


August /September 89 

66 Micro Journal 

After the coding Is done, the designer can Invoke the 
OS-9 MAKE utility from within the Presentation Editor 
to compile and link the application. Once the applica- 
tion is created It can be executed and any debugging or 
changes made to it. For example, if the designer 
decides a horizontal slide bar would be more appropri- 
ate than a vertical one. the object can be loaded into the 
Presentation Editor, modiiied and the application re* 
made in a matter of minutes. 


Today and In the future there will be a greater need 
for veiy intuitive and natural Interfaces between com- 
puting systems and their users. RAVE offers a package 
that supplies the basic tools to create such inteifaces 
now. RAVE was created out of the evolving CD-I 
consumer technology to provide a process control 
environment that is fully multi- tasking and has multi- 
media objects which can mimic real world objects In 
appearance, behavior and sound. This allows a natu- 
ral, easy to use Interface to be created; an interface that 
can be used without extensive training or computer ex- 

About the Authors: 

Tim Harris is a Senior Software Engineer for Microw- 
are Systems Corporation. Tim was one of the original 
designers of the RAVE software for CD-RTOS and has 
been involved In the project since that time. He re- 
ceived a B.S. in computer science and psychology from 
Iowa State University in 1984. 

Lee Glenn Is a Software Engineer also with Microw- 
are Systems Corporation. I,ee has been involved in 
graphics, CAD and image processing for a number of 
years and wrote the first CD-I application. I,ee has 
degrees in computer science from Simpson College 
and mechanical engineering from the State University 
of New York. 

With the RAVE development tools, a new approach 
to programming is available. A sophisticated interface 
does not require many man hours of programming 
with RAVE. Instead an application designer can spend 
time interactively designing objects and laying out 
screens with the user in mind. The programmer is 
responsible for only a small amount of actual hand- 
written code. 

Finally, because each object can be modified inde- 
pendently, application designers can focus on creating 
an optimal lnteiface without the extensive re- writing of 




68 Micro Journal 

August /September '89 




By: Peter Dibble 

49 Stony Lonesome Road 
Homeoye Falls. NY. 14472 


The world was much different 
when OS-9 was designed. We 
thought of 16K of RAM about 
the way we think of 4M these 
days: a system with 32K of RAM 
was big. Five inch floppies held 
about 100K, and hard disks 
were out of the question. 

Expensive RAM was a man- 
ageable problem when simple 
programs ran one at a time, but 
even back then it was plain that 
eight kilobytes of RAM was not 
going to make it in a serious 
multitasking system, lypical 
programs were getting bigger 
and the multitasking that was 
designed into OS-9 needed sev- 
eral programs in memory at the 
same time. ROMs were a way to 
cut RAM requirements and re- 
duce (or eliminate) the effect of 
slow disk drives. 

Mask programmed ROMs 
were inexpensive compared to 
RAM. A system that could run 
with most of its software in 
mass-produced ROM could get 
by with less RAM, and mass 
storage for programs would not 
be an issue. Motorola latched 
onto this idea and it became one 
of the assumptions used to 
design OS-9. This design goal 

had broad inlluence on OS-9. 
and traces of it survive to this 

It would not be practical to 
produce mask programmed 
ROMs for each system configu- 
ration. Small runs of masked 
ROMs were (and still are) expen- 
sive. One solution would have 
been to create one standard 
ROM full of wonderfully flexible 
software then hope that every- 
one would be happy with the 
standard package. Instead, OS- 
9 treats ROMs as building 
blocks and the system finds 
ROMs and organizes the data 
they contain. Provided that the 
software is well designed, it's 
easy to assemble a collection of 
ROMs into a deeply specialized 
package. Even the OS-9 operat- 
ing system is a set of compo- 
nents that fit together when the 
system is booted. 

A basic problem with "soft- 
ware in silicon" is addressing. 
What if someone wanted to in- 
stall a math package and a 
spreadsheet, but both of them 
needed to go in the $7800 ROM 
slot? Should ROM manufac- 
tures sell a version of the ROM 
for every possible address? OS- 

9 solves this problem with posi- 
tion independent code and 
data. A software chip will work 
at any address. 

ROMed software posed plenty 
of other problems, for instance: 

•How can the system find and 
incorporate ROM software dur- 
ing bootstrap? 

•What if there is a bug in some 
ROMed software? 

•How can software from disk 
be used to augment a ROMed 

For that matter, how can one 
ROM update software in an- 


The bootstrap problem is 
enough to explain OS~9*s mod- 
ules and CRC codes. During the 
OS-9 bootstrap procedure, the 
kernel searches through mem- 
ory for ROM and RAM. It iden- 
tifies RAM by storing two differ- 
ent values into the same loca- 
tion and reading them back. 
ROM and addresses with no 
memory both fail the RAM test. 
Ihe kernel takes special inter- 


August /Septombor'89 

68 Micro Journal 

est in addresses that fail the 
RAM test because they might 
contain ROMed software. 

OS-9 packages software in 
carefully marked "modules" so 
it can be distinguished from 
Junk. A module starts with a 
sync code, then there is a mod- 
ule header with a parity check. 
The most rigorous test is a 24- 
bit CRC code stored at the end of 
the module. The sync code is 
easy to recognize, but it could 
show up anywhere. The kernel 
would find lots of false modules 
if the sync codewereall ithadto 
go on. After the kernel has 
found a sync code and a correct 
header, chances are good that it 
has a real module. The CRC 
code is a mathematical function 
of the rest of the data in the 
module. The OS-9 kernel 
checks the CRC code for each 
proposed module. If the calcu- 
lated CRC matches the code 
stored where the end of the 
module should be, the kernel is 
satisfied that the memory con- 
tains a valid module and 11 lists 
the address of the module 
header in the module directory. 

A module is a package of data 
(usually a program). Along with 
the distinguishing marks that 
help the kernel recognize it, 
each module module header 
contains codes that character- 
ize that module: data like the 
module name, its type, the lan- 
guage code it uses, and its RAM 

Plug a ROM with a graphics 
package into an OS-9 system, 
then boot the system. The 
graphics package will be in the 
module directory ready to run. 
Any programs in the ROM can 
be run by naming them In the 
OS-9 shell. Other module 

types, such as subroutine mod- 
ules and device drivers, are 
known by name to other mod- 
ules and dynamically linked. 

Version Numbers 

It used to be rather common 
to package the most common 
utility programs on one ROM. If 
all software were bug free and 
equipped with every useful fea- 
ture, it would be fine to have 
everything cast in silicon, but 
what do you do when one of the 
utilities needs a one-byte 
patch? Get a whole new ROM? 
OS-9's answer is kernel sup- 
port for version numbers. When 
the kernel has a choice between 
two modules with the same 
name it chooses the module 
with the higher version number. 

To patch a module in ROM 
you follow these steps: 

* Save the module to disk 

* Make the patch on disk 

* Increment the version num- 
ber of the module on disk 

* Correct its CRC code. 

When the revised module is 
loaded into memory it will sup- 
plant the module in ROM. 

Dynamic Binding 

Modules, including the OS-9 
kernel, don't know where to find 
other modules. All they can 
know is the names that other 
modules will use, but that is 
enough, (Think of modules as 
analogous to files on a disk. A 
module's address is like the 
sector number where the file 
starts. It's not the kind of thing 
you want to hard-code into a 
program.) Given a module 

name, the F$Link system call 
will return an address that will 
reach that module. Compli- 
cated software often consists of 
several modules that find one 
another at run time. Since each 
module is found by name, the 
behavior of the system can be 
changed by substituting a dif- 
ferent module with the same 

This dynamic-binding fea- 
ture is so commonly used that it 
is taken for granted. One ex- 
ample is the handling of the 
68881/2 math coprocessor 
under OS-9/68000. A program 
may choose to have complex 
mathematical functions exe- 
cuted by a standard trap han- 
dler named "math." The default 
math module does all its calcu- 
lations using the 68000 in- 
struction set. but there is an 
alternate math module that 
uses the 68881 coprocessor. 
Programs will use whichever 
version of math is in memory, so 
software can be upgraded to use 
the coprocessor quite pain- 
lessly. The math module that 
uses the 68881 is smaller and 
faster than the math module 
that does IEEE floating point in 
software but that is the only 
visible difference. 

I frequently benchmark soft- 
ware with the software version 
of the math module. I copy 
math, soil ware into math in my 
CMDS directory. Next time I 
boot the system it comes up 
using software floating point. (I 
could do this change without 
rebooting, but this way is easy.) 
Once I forgot to return to hard- 
ware math mode by copying 
math.881 into math. I happily 
used my computer for months 
before I ran a floating-point pro- 
gram that was so slow I was 

68 Micro Journal 

August /September '89 


convinced that something was 
broken. Eventually I tracked 
the performance problem down 
to the math module and fixed It 
with a quick copy command. 
For months Yd been using the 
wrong math module and no 
program had noticed. OS-9 
users take this sort of Inter- 
changeable part for granted. If 
one of the OS-9 hardware ven- 
dors gives us a Weitek floating 
point chip, we'll expect him to 
Include a math. weitek module. 

The OS-9 I/O subsystem also 
configures Itself dynamically. 
Device names refer to modules 
called device descriptors. These 
modules contain various facts 
about the device. Including the 
name of a device driver module 
that will handle low-level I/O 
details, and a file manager that 
will handle high-level process- 
ing. When a program opens a 
path, the kernel (or IOMan on 
OS-9/6809) locates the three 
modules Involved and binds 
them Into a team. The I/O situ- 
ation Is fluid. I load the SBF file 
manager and the driver and 
descriptor for my tape driver 
about once a week for my weekly 
backup. There's no point in 
wasting memory on the mod- 
ules the rest of the time. When 
I'm ready for my lunch break on 
Saturday. I type 

load sbm20 sbf mtO 

then I start the backup. When 
the backup is done I type 

deiniz /mtO; unlink mtO sbf 

and the modules are removed 
from RAM. I use my PC file 
manager software the same 
way. loading it when I need it 
and unlinking it when I'm done. 

Loadable device drivers and 
shared libraries are relatively 
new ideas in the UNIX(TM) 
world, and they are painful 
grafts onto that operating sys- 
tem. For OS-9. they are conse- 
quences of the baste design 

Software on silicon never 
really made it. Maybe RAM 
prices fell too fast for it. How- 
ever, the desljpi features of OS- 
9 that were motivated, at least 
in part, by the ROM Idea, are 
still close to the leading edge. 






August /September'89 

68 Micro Jotmal 

The Motorola 68000 Family 

A Historical Perspective 

Tom Johnson 

68000 Applications Engineer 

Hi-End Product Marketing 

Motorola, Inc. 

6501 William Cannon Dr, West 

Austin, TX 78735-8598 

In the b 


By the waning years of the 1970's, things were aboul normal for 
ihc electronics industry, and for ihe world in geneial. The war in 
Viet Nam was slowly fading from memory, Jimmy was president, 
"Billy Beer** was ihe rage, inflation was geaiing up to double 
digits, and the largest selling computer was the Digiial Equipment 
Coip. PDP-8. The integrated circuit industry was firmly estab- 
lished, most programs were written in assembly language, and 64k 
bytes of address space still seemed like a lot. The tenn "micropro- 
cessor" was still new and exciting, and the most sophisticated 
MPU available was the 6000-gatc hard- wired Motorola 6800. 
Issues of Radio Electronics still ran articles on how to build PONG 
games and "do-it-yourself* 8080-bascd computers. Microsoft 
wasn't yet a world power. CPM was the operating system to end 
all operating systems, and IBM only made mainframes. Process- 
wise, 5 micron NMOS was the process of choice for microproces- 

During the fall of 1977, barely 4 years after the introduction of 
the 8080, in a conference room in Austin, Texas, several engineers 
gathered together to discuss a "next generation" microprocessor. 
In attendance weic some of the leading microprocessor visionar- 
ies: process engineers, design engineers, packaging engineers, 
software engineers, marketing experts, and one man whose vision 
would become a legend in the microprocessor aicna, Tom Guntcr. 
These people were gathered to talk about Motorola's next step in 
evolution for the 6800 family. Gunter proposed a 16-bit micropro- 
cessor with extensibility to 32-bits — a radical proposal for the 
lime, considering thai there existed no market for such a part. 
Several attendees argued that a processor this complicated 
couldn't be made from existing technology. Some argued for a 
code compatible MPU, like the rumored 8088 from Intel. What 
Mr. Guntcr proposed was a microprocessor containing aboul 
68,000 transistors — greater than an order of magnitude moic than 
ever before manufactured. The pari would be made in 3 micron 
HMOS— a process ihatdidn'tyetexisi! Thedie would bcHUGE 
— larger than any ever attempted for a commercially produced 
integrated circuit The package would contain 64-pins. The clock 
speed — 4 MHz, single phase! Laughable. The device would 
contain 32-bii data paths and two separate ALU's. Impossible. 
And finally, there was the small matter of microcode. 

You Want to Use WHAT? 

Microcode was still a new and unusual beast for microproces- 
sor engineers. True, mainframes had used this technique for a 
while, and the AMD 2900 required microcode, but no one had ever 
tiicd to pui microcode on the same device as the CPU. Many said 
it couldn't be done. The sheer size of the proposed device meant 
that hardwiring all instructions would be impossible. Microcode 
would be required. But even using either atradilional single-level, 
or iwo level microcode approach would result in a device too large 
to be producible. What was required was a totally new approach 
lo the problem. A split-level microstore was proposed, where a 
first, narrow half, with a fully populated micro-address decoder, 
would control the subsequent sequence of instruction microad- 
dresses. A second, wider control half with a ''sparsely populated" 
microaddrcss decoder would actually control the device. The use 
of a "sparse" decoder allowed more than one microaddrcss to share 
the same contiol state. This sharing of control slates between (pos- 
sibly) many microaddresses resulted in significant silicon savings. 
Microcodes could now re-use control slates for as many instruc- 
tions as necessary, greaily reducing ihe overall storage require- 
ments for the microcode, while ai the same lime ensuring that all 
possible instruction op-codes were fully decoded to trap illegal bit 

The reception to this idea of Motorola pouring R&D money into 
a device which couldn't be built would have been cold indeed if not 
for a few of the other attendees. H had been theoretically proven 
that the split-level microcode structure could woik. It had been 
proven, again theoretically, that the design could be produced 
using existing (and some not-yet-existing) computer software. 
The process engineers were pretty sure that a 3 micron HMOS 
process could in fact be ready in lime to process the design. Pack- 
aging said thai a 64-pin DIL package, while expensive, was not 
unrealistic. Fabrication engineers said lhat, while yield would be 
low initially, they ihought that such a complicated device might be 
producible. Motorola bet the farm thai its team of microprocessor 
gurus could pull off what would be perhaps ihe most complicated 
engineering feat of the century — the 68000. 

68 Micro Journal 

August /September 89 


A Blueprint tor Success... 

What made Ihc 68000 so innovative? For ihc first time in the 
short history of microprocessors, software engineers were in on the 
design from the vciy beginning. The concept was lo create an 
extensible architectural platform which would allow Motorola lo 
provide new family members with increasing performance and 
functionality, while at the same lime, providing a basis for the easy 
implementation of high-level language compilers. It was thought 
at the lime, and rightly so, that most future software development 
would be in high-level languages. If this concept was accepted as 
fact, then ihc architects of the new processor should look to those 
platforms which were already being used primarily for high-level 
languages — minicomputers and mainframes. In order to provide 
this high-level language support, while maintaining an open eye to 
the future, several precepts should be adhered to. The number of 
instructions should be kept reasonable — this icduccs the effort 
required on the part of the compiler to choose the correct instruc- 
tion. Special -purpose instructions, and dedicated registers should 
be kept to a minimum — this allows compilers toallocatc registers 
without worrying about later register conflicts with other instruc- 
tions. The available addressing mode set should be as rich as 
possible to give the compiler ihc maximum flexibility in accessing 
memory. Finally, the machine should display reasonable orthog- 
onality for addressing modes with respect to register usage, in- 
structions with icspccl to register usage, and addressing modes 
with respect to instructions. All of these precepts must be kept 
foremost, while remembering the limited silicon real-estate avail- 

Early in ihc design cycle, it was decided that wherever a trade- 
off must be made, it would be made in the direction of greater 
performance rather than greater functionality. This discarded 
functionality could be added later, if it was still deemed desirable, 
in future family members. Oncofthc biggest decisions made in the 
design was ihc decision to abandon upward instruction-level 
suppoit for the 6800 family. This wasa radical decision. Intel had 
paved the way in microprocessors, by fully supporting the 8008 
programming model in the 8080, and later in the 8088 and 8086. 
Ztlog had produced the Z80 offshoot which still maintained 
softwarccompaLibiliiy wiih the 8080. For Motorola to not support 
like 6800 family in ihc 68000 was almost heretical. All 6800 
software would need to be thrown away .and re-made from sciatch. 
Once this decision was cast in concrete, a single concession to the 
past was made — ihc 68000 would support the uscof 6800 family 
peripheral devices. Why? 

On IVe-inventing the Wheel... 

In deciding on peripheral support for the new processor, there 
wcic basically two trains of thought: one was to hire more design 
engineers and try to design a complete family of peripherals in 
landcm wiih the processor design, ihc second was lo rc-usc the 
existing 6800 peripherals. Eiihcr paih was sirewn with pitfalls. If 
new peripherals would be designed, then literally millions of 
dollars in existing peripheral designs would be scrapped, and the 
rc-designs would cost the company both time and money. If the 
second path was chosen, then concessions would have to be made 
in the hardware and insiruction set. using valuable silicon lo 
support older devices. Fiom the vantage point of 1989, the 
decision seems simple, but then we have the benefit of hindsight. 
In 1 977. thedecision was much morcdifficulL The wrong decision 
might result in the failure of the product line, the loss of large 
chunks of revenue for ihc company, and the firing of many persons. 
Luckily, the correct decision was made. 

I o Separate Or IMot to Separate... 

Many people have commented on the separation of data and 
address registers in the 68000 user programming model (figure I ). 
Why was this dual-register approach chosen over a simpler single 
bank of 16 registers? Three major reasons predicated (Jus design 
decision. First, a single, large register bank would be more difficult 
to control due to speed path problems in the register selection 
hardware. The more registers, the higher the capacitance in the 
selection logic, and ihc slower the device would run. Second, the 
software engineers on the project wcic convinced that address 
quantities should be treated differently than data quantities. 
Addresses arc, after all, basically vectors into the memory space, 
and as such contain both a magnitude and a direction (sign). 
Operations on these quantities should not set condition codes, and 
operations on less lhan ihc loial should maintain both sign and 
magnitude. This obviated the need for a separate ALU in handle 
addresses, and thus, separate address registers to simplify the 
circuit paths. The third reason for separation between addresses 
and data deals with the number of bits required in the instruction 
to specify the source or destination register for an operation. With 
16 registers. 4 bits would be required for both source and destina- 
tion — a total of 8 bits, and at least 6 more bits would be required 
to specify the source and destination addressing modes — a total 
of 14 bils. leaving only 2 bits left over to specify the operation to 
be performed. While the 68000 was to have a limited instruction 
set. it was decided that 4 instruction classes would probably not be 
enough. Lim iting the register structures to 8-cach of addicsscs and 
data operands reduced Ihc encoding bit requirement to \2 bits, 
leaving 16 insiruction classes. This would be sufficient. 


August /September 89 

68 Micro Journal 


M68000 Family 

User Programming Model 

II was determined that future software requirements would 
slowly gravitate toward 32-bits. The values of ±2 billion allowed 
sufficient integer flexibility to handle most scientific problems. 
Tliirty-iwo bits of address allowed plenty of headroom for most 
foreseeable addressing needs within the next couple of decades. 
Sixiccn-bit integer and address quantities, on the oihcr hand, were 
already limited by the end of the 70's. Rather than make the 
processor act on strictly 16-bii quantities, it was decided that for 
future extensibility and performance, all registers (both address 
and data) would handle 32-bit quantities, but due to silicon area 
restrictions, the ALU's would be limited to 16-bits. 32-bit opera- 
tions would be handled automatically by multiple passes through 
the ALU's. Future family members could implcmcniall 32-bits of 
the ALU's, effectively doubling the speed of 32-bit operations. 
Instructions, and the ex tcrrtal daia bus would be 1 6-bits to allow for 
maximum performance within ihc packaging limitations* and the 
external address bus would be limited to 24-bits, although all 32- 
bits of ihc program counter would be implemented. 

Reaching Outward... 

Also early on in the design, it was determined that the external 
interface provided the designer should be as flexible as possible, 
reduce ihc external device count, and lake advantage of ihc latest 
in high-speed memory designs. To this end, the 68000 was to 
implement a 4-clock cycle asynchronous non-multiplexed bus 
cycle. This unique interface would have the processor contain the 

synchronizing logic, and would allow each type of memory device 
(RAM, ROM, EPROM, peripherals, etc) to respond in its own 
optimum period of time — thus increasing overall performance. 
Additionally, a bus thus structured would easily allow the intro- 
duction of "waitstaies", something brand new in microprocessors. 
An interesting side note here i s that 1 he 68000 's ALU cycles in only 
3 clock cycles, while the bus cycles in 4 clock cycles. Thc68000's 
bus could easily have been designed for 3-clock cycle operation 
(memory access * 105 ns@ 8 MHz ), but since few existing 
memory devices could keep up at this speed, it was determined for 
marketing reasons to make the bus cycle 4-clocks (memory access 

...And Upward... 

The 68000 iniroduccd several new concepts to microproces- 
sors: separation of user and supervisor code and data spaces, 
restrictions on self-modifying code, on-chip 7-lcvcl interrupt 
controller with automatic masking of interrupts, on-chip exception 
processing with 256 exception vectors, fully-trapped op-code map 
(no more wicrd undocumented instructions), etc. Ihc fi rstof these 
recognized the differences between operating systems and user 
applications, allowing operating systems to be written which 
operated in memory areas inaccessible to applications. System- 
level tasks were given extra resources and instructions also not ac- 
cessible to applications (figure 2). As new features were later 
added to the 68000 family, it was this "privileged" set of resources 
which was modified, allowing all user-level object code to be 
moved intact to newer family members. The foresight of the 
architects of the 68000 family can be seen in the lack ofcrudc hacks 
and special operating modes to support antiquated system-level 


16 15 

8 7 

I I 

I I 




A7 (SP) 



68 Micro .bumal 

August /September '8 9 


Figure 2 

M68000 Family 
Supervisor Resources 

1 ime iVlarches On... 

The basic 68000 archiuxriuic has been enhanced over the years, 
adding viuoal mcmoiy and virtual machine suppoil, cache memo- 
ries, dynamic bus sizing, faster clock speeds (up lo 50 MHz), and 
a plethora of other high-level firsts. Performance has been in- 
creased from the "paltry" .35 MIPS of the original 4 MHz 68000 
to 12 MIPS for a 33 MHz 68030. Fuluic family members will 
move into even higher pcrfoimancc areas. Ten years ago, the 
68000 set the standard by which all future microprocessors would 
be judged. Ten years ago. the 68000 introduced the word "super- 
lative" into the vernacular of microprocessors. Today, the 68000 
is a simple commodity part, overshadowed by its own offspring, 
and by ultra-high performance microprocessors like the 88000 
RISC and like genre. The 68000 spawned industries never before 

possible — scientific workstations, windowing systems, distrib- 
uted processing CAD/CAM, desktop publishing; and pushed 
others to new heights — robotics, factory automation. UNIX, etc. 

It is uuc that from small acorns large oak trees grow, and only 
a few attendees at that first meeting in the fall of 1977 had even a 
glimmer of the possibilities of the new architecture they were about 
to unleash on the world. The microprocessor which couldn't be 
built The Motorola 68000. The 68000 was introduced to the 
world in July of 1979, and since, over 25 million 68000 family 
processors have made Ihcir way into the mainstream of day-to-day 
computing. As they say..."lhc rest is history." 

31 16 15 


































August /September '89 

68 Micro Journal 

Office A utomation Package 

Microwarc Systems Corp. 

1900 N.W.114[h Street 
Dcs Moines, Iowa 50322 

Phone: 515/224-1929 

Western Regional Office 

4401 Great America Parkway 

Santa Clara, California 95054 

Phone: 408/980-0201 

Microwarc Japan Ltd. 

41.19 Honcho 4-Chomc 


Chiba 273, Japan 

Phone: 0474 (22) 1747 


Microware is proud to announce the immediate availability of SmartWare, a 
powerful, integrated spreadsheet, data base, word processor and time manager 
package for OS-9/68000. Licensed from Informix, a leader in SQL and office 
automation technology, SmartWare has been adapted to the OS-9 environment and 
works with virtually any ASCII terminal. 


• Multi-Level Password Protection 

• Linked-Window Scrolling 

• Keyboard Macros 

• Access to OS-9 without Leaving SmartWare 

• Personal "Time Manager" Appointment Calendar 

• On-Line "HELP" 

The SmartWare integrated software package provides the productivity tools 
engineers need to write proposals, model new systems, manage information and 
communicate with others. 
Smart is comprised of five integrated software modules: 

• Data Base Manager 

• Spreadsheet 

• Word Processor 

• Communications Package 

• Time Manager 

Each of the individual SmartWare modules is capable of outperforming any stand- 
alone program in its category. However, SmartWare's real advantage lies in its 
ability to easily move data from one integrated module to another. All SmartWare 
packages feature common commands and screen designs to maximize ease of use. 
A menu umbrella provides a cohesive user interface which ties all modules 
together into a seamless, integrated package. 

68 Micro Journal 

August /Septemher'89 


Data Base 


SmartWare includes a fully relational data base manager. Each data base can 
contain up to one million records with each iecord supporting a maximum of 255 
fields and 4,096 characters. Several diffeient field types are available including 
alphanumeric , numeric, date, time, phone, sequential and inverted name. With the 
inverted name function, the field is sorted on the last word in the field. Up to 15 key 
fields (with U000 characters each) can be defined for each record and a key field 
can also be used to peifoim fast searches. 

Creating a data base is easy and involves three simple steps: 

First, create a file structure by defining fields. Second, create a data entry screen 

(a default comes with the package). And finally, enter the necessary data. A 

variable length record option allows SmartWare to only store the data actually 

contained in each field. Conversely, fixed length fields provide faster access to 

data retrieved from disk. A password protection mechanism offers secure data 


Once data is entered, SmartWare provides easy access using queries and custom 
reports. The queiy command isolates a subset of the data base file. The query 
command can be used to select upper and lower field values, relational operators 
and to set the order of evaluation. Custom reports are readily available using the 
44 report" command. This command specifies fields to be printed and report format. 
Reports can be structured as either reports or forms. A variety of column 
definitions and number formatting facilities make reports easy to generate and 

The SmanWaie spreadsheet contains a number of features found in other popular 
spieadsheet software packages, plus many unique enhancements. The capacity of 
the spreadsheet is 9,999 rows x 999 columns. A "sparse matrix" algorithm is used 
to save spreadsheet information, minimizing RAM/disk storage requirements and 
speeding execution. Up to 50 windows are available on any one screen to display 
consolidated worksheet data. Other spreadsheets may be accessed using formulas 
in the spreadsheet module. 

SmartWare is one of the very few spreadsheets that provide linear algebraic 
functions. Matrix commands provide the abilities to generate eigenvalues and 
eigenvectors and to invert matrices using the Gauss-Jordan method. Eight other 
types of calculation may be used including math, trigonometric, statistical, 
financial, date, time and regression analysis. 

A powerful graphics command can be used to print data in a variety of forms. Two 
and three-dimensional bar charts, line and scatter plots, plots (bar, line and scatter 
combinations) and pies (including 3-D) can be easily printed using a dot-matrix 

Continued on page 35 


August fSeptember'89 

68 Micro Journal 

Trfcpfwm-: (615) 842-4600 Sotltfl 'EdSt !Me(tia 


'J it\: (615)842-7990 


ASTRUK09 from S.E. Media « A "Siructurcd Assembler for the 6809" 
which require* the TSC Macro Assembler. 
FLEX, SK DOS. CCF - $99.95 


SUPER SLEUTH from Computer Systems Consultants Interactive 
Disassembler; extremely PO WERFUU Disk File Binaiy/ASCIl 
Examine/0>ange. Absolute or FULL Disassembly. XREF Generator, 
I jbel "Name Qianger ', and Files of "Standard Label Names H for 
different Operating Systems. 
Color Compuitr SS50 Bus (all w/ AL Source) 
CCD (32K Req'd) Object Only U9 00 

FUX, SKDOS $99.00 - CCF Object Only $5000 UniFLEX $100.00 
CCF, wiih Source $99 DO 0S.9, $101 DO ♦ CCO, Object Only $50.00 
680 JO SUPER SLEUTH . Simdiar to SDtt Version except written 
in "C 

69010 Disassembler $10000 FLEX. UntFLEX, UNIX. XENIX. 

OS+9/68K Object Only $100.00 or with Source $200 00 
DYNAMITE* - Excellent standard "Batch Mode" Disassembler. Includes 
XREF Generator and "Standard Label' Files. Special OS-9 options 
with OS-9 Version. 

CCF, Object Ody $100 DO * CCO. Object OntyS 59.95 

FLEX. SKDOS , Object Only $100.00 - OS -9. Object Only$150D0 

UniFLEX Object Only $300 DO 


CROSS ASSEMBLERS from Computer System Consultants -- Supports 
18D2/5, Z-SO, 6MXy l/2/3/a/l 1/IIC1 1. 6WM. 6805/14005/ 146805. 6809AJQ/OI. 
65t2 family. S08CV5. 8020/1/2/35/C35/39/40/48/C48/49/C49/5CV8748/49. 
803 1/5 1/875 1,32000 and 6*000/680 10 Systems. Assembler and Listing 
formats same as target CPU's format- Produces machine independent 
Motorola S-Tcxt. Includes Macro Prc-Proccssor. Written in "C". 68000 or 
6809 "Mocintosh'Atari, FLEX, CCF. UniFLEX, OS-9, XENIX. UN/X, MS- 

any object $50 or any 3 for $100 

any source is an additional $50 or any 3 for $100 

Set of ALL object $200 DO ♦ with source $500 DO 


CMODEM Telecommunications Program from Computer Systems 

Consultants, Inc. — Menu-Driven; supports Dumb Terminal Mode. 
Upload and Download in non protocol mode, and the CP/M "Modem?" 
Christensen protocol mode to enable communication capabilities for 
almost any requirement. Written in "C. 

with Source $100,00 - without Source $50 DO 

XJALX wiih CMODEM Source $149.95 


PASC from S.E. Media - A FLEX9. SKDOS Compiler with a definite Pascal 
"flavor". Anyone with a bit of Pascal experience should be able to begin 
using PASC to good effect in shun order, lite PASC package comes 
•ompletc with three sample programs: ED (a syntax or structure editor). 
EDITOR (a simple, public domain, scram editor) and CHESS (a simple 
chess program), lite PASC package comes complete with source 
(written in PASC) and documentation. 

WHIMSICAL fiom S.E. MEDIA Now supports ReatNumbers "Slructuicd 
Programming" WITHOUT losing the Speed and Control of Assembly 
Language) Single-pass Compiler features unified, user-defined I/O; 
proj luces ROMablc Code; Procedures and Modules (including pre* 
compiled Modules); many "Types" up to 32 bit Integers, 6-digit Real 
Numberi, unlimited sized Ariays (vectors only); Interrupt bundling 
long Variable Names; Vanablc Initialization; Include directive; 
Conditional compiling; direct Code inscition; control of the Stack 
Pointer; etc. Run-Time subroutines mscned as called during 
compilation. Normally produces 10% less code than PU9 
FIEX. SKDOS and CCF . $195.00 

KANSAS CITY IIASIC from S.E Media -Basic for Color Compuitr OS-9 
with many new commands and sub-functions added. A full 
implementation of the IF-TIIEN-ELSE logic is included, allowing 
nesting to 255 levels. Stiings are supported and a subset of the usual 
siring functions such as LEFIS. RIGHTS. MIDS, STRINGS, etc are 
included. Variables are dynamically allocated. Also included are 
additional features Mich as Peek and Poke. A must for any Color 
Computer user running OS-9. 
CoCoOS-9 $39 95 

OincgaSoft PASCAL from Certified Software -- Extended Pascal for 
systems and real-time programming. 

Native 684XXV68020 Compiler. $575 for base package, options available. 
For OS-9/68000 and PDOS host system. 

6809 Cross Compiler (OS-9/68000 host) $700 for complete package. 

K BASIC * from S,R MEDIA - A "Native Code" BASIC Compiler which is 
now Fully TSC XB ASIC compatible, lite compiler compiles to 
Assembly language Source Code. A NEW, streamlined. Assembler is 
now included allowing the assembly of LARGE Compiled K-BASIC 
Programs. Conditional assembly rcduaes Run-lime package. 
FLEX, SKDOS, CCF. OS 9 Compiler (Assembler $99 DO 


JUST from S.E. Media - Text Formatter developed by Ron Andcison; for 
Dot Matrix Printers, provides many unique features. Oulpui 
"Formatted" Text to ihe Display. Use the FPRINT.CMD supplied for 
producing multiple copies of the "Formatted" Text on the Printer 
other times also, and worth the price of the program by itself). "User 
Configurable" for adapting to other Pi inters (comes set up for Epson 
MX -80 with Graft/ax); up to ten (10) imhedded "Printer Control 
Commands". Compensates for a "Double Width" primed line. Includes 
ihe norrrvaJ line width, margin, indent, paragraph, space, veiticil skip 
lines, page length, page numbeiing. centering, fill, justification, etc 
Use with PAT or any other editor. 

* Now supplied as a two disk set: 

Disk »J JUST2 CMD object fde J UH7.IXTPL9 source FLEX, SKDOS 

Disk *2 JUSrSC object and source in C FLEX, SKDOS. OS 9. CCF 

A»aJbb4lliy Uf«Mfa 
O . OS-t, S • SK •DOS 
V - VlAX, 1 1 - UniFLEX 
OCt • Color Computer OS.9 
CCV . Color Computer FUX 

South "East Media 

5900 Cassandra Smith ^. • Mvrjon, 7k 37343 
ttltphont: (613)842-4600 9SLX ($15) 8427990 

•• Shipping •• 

Add 1% U&A, (mtn, lift) 
Porcfen Surf** Add 5% 
foreign Airmail Add 10% 
Or CO.D. Shlpplnt Only 

♦QS»9 tea Tr»dtmT* of Mfcfow>r» apd MotortAa- «FLKX and UnlFLKX ire Tradcmarfci of Technical Sjrtema Coniyltantj-'SKTJOS ti m Trademark P r Star-K Software SyH*nn t jot p. 

68 Micro Journal 

August /September 8 9 


, 6 1 s) 842-40OO Sou tfi ( Eas t Media 

OS 9, itnPJVLX, 'JL'LX, S'K'DOS 

fa*: (615) 842-7990 

The J ISC and regular JUST C source are iwo separate programs. Jl SC 

compile! lot version thai expecti TSC Word Processor lype commands, 
(.pp .ip .ce etc.) Great for your older lexi files. The C souice compiles lo 
a standard syntax JUST.CMD object file. Using JUST syntax (, p jo ,y 
etc.) Wiih all JUST functions plus several additional punier formatting 
functions. Reference ihe JUSTSC C source. For those wanting an 
excellent BUDGET PRICED word processor, with features none of ihe 
others have. This is itt 

Disk (I) - PL9 FLEX only- FLEX, SKDOS A CCF - $49.95 
Disk Sel (2) - FLEX. SKDOS <& CCF <£ OS 9 (C version) - $69 95 

OS9 6BK000 complete with Source - $79.95 
PAT from S.E. Media - A full feature screen oriented TEXT EDITOR wiih 
all ihe besi of H PJE™ H . For those who swore by and loved only PIE, 
this is for you! All PIE features and much morel Too many features to 
list. And if you don't like these, change or add your own. PL-9 source 
furnished. "C" source available soon. Easily coniigujed lo your CRT, 
with special con fig section. 

FLEX, SKDOS $129.50 

FLEX. SKDOS $99 95, OS 9 68K Version $229.00 

Note: JUST in "C" source available for OS 9 
CEDR1C from S.E. Madia - A screen oriented TEXT EDITOR wiih 

availability of 'MENU' aid. Macro definitions, configurable permanent 
definable MACROS' - all standard features and ihe fastest 'global' 
functions in the west. A simple, automatic terminal con fig program 
makes this a real no hasseT product. Only 6K in size, leaving ihe 
avenge system over 165 sectors for text buffer * app*> 14,000 plus of 
free memory t Extra fine for programming ai well as text 

FLEX, SKDOS $69 95 
BAS.EDIT from S.E- Media - A TSC BASIC or XBAS1C screen editor. 
Appended to BASIC or XBASIC, BAS-EDIT is transparent lo normal 
BASIOXBASIC operation. Allows editing while in BAS1C/X BASIC. 
Support! ihe following functions: OVERLAY, INSERT and DUP 
LINE. Make editing BASIC/XBASIC progiams S1MPLE1 A GREAT 
time and effort saver. Programmers love itt NO more retyping entire 
lines, etc Complete with over 25 different CRT terminal configuration 

FLEX , CCF, SK DOS $39.95 
SPELL B "Computer Dictionary** from S.E. Media -• OVER 150,000 words! 
Look up a word from within your Editor or Word Processor (with (he 
SPH.CMD Utility which operates in the FLEX, SKDOS UCS). Or 
check and update the Text after entry; ADD WORDS to the Dictio ly, 
"Flag" questionable words in the Teat, "View a word in conie*r before 
changing or ignoring, etc. SPELLB first checks a "Common Word 
Dictionary", ihen the normal Dictionary, then a "Personal Word List", 
and finally, any "Special Word List" you may have specified. SPELLB 
also allows ihe use of Small Disk Storage systems. 

FLEX t SKDOS and CCF - $129 95 
STYLO-GRAPH from Great Plains Computer Go. - A full-scrsjen onented 
WORD PROCESSOR - (uses the 51 x 24 Display Screens on CoCo 
FLEX/SK-DOS, or PBJ Wordpak). Full screen display and editing: 
supports the Daisy WheeJ proportional pi inters. 

NEW PRICES 6809 CCF and CCO - 500.05. 

FLEX. SKDOS or OS 9 . $179.95. VniFLEX- $299.95 
STYLO-SPELL from Great Plains Computer Co. - Fast Computer 
Dictionary. Complements Stylograph. 

NEW PRICES 6909 CCF and CCO , $69.95. 

FLEX. SKDOS or OS-9 - $99 95. UniFLEX- $149,95 

STYLO-MERGE from Great Plains Computer Co. ~ Merge Mailing List lo 
"Form" Letters. Print multiple Files, etc. through Stylo. 

NEW PRfCES 6809 CCF and CCO . $59.95, 

FLEX, SKDOS or OS-9 - $79.95, UniFLEX* $129 95 
STYLO PAK -- Graph + Spell + Merge Package Deal)!! 

FLEX. SKDOS or OS 9 - $329.95. UmFLEX - $549.95 

OS-9 68000 $695.00 


XDMS from Westchester Applied Business Systems 

FOR 6809 FLEX or SKDOS <S/*") 

Up lo 32 groups/fields per recordl Up lo 12 character Hie namesl Up to 1024 
byie recordsl User defined screen and piint control! Process lilesf Form 
files! Conditional execution! Process chaining! Upward/Downward file 
Lnkingl File joimngl Random file virtual paging! Built in utilities! Huili 
in text line editor! Fully session orientedt Enhanced forms! Hold face, 
Double width. Italics and Underline supported! Written in compact 
stiuctured assembler! Integrated for FAST execution! 
XDMS-IV Data Management System 

XDMSJV is a brand new approach lo dala management It not only permits 
users to describe, enter and retrieve data, but also lo process entire files 
producing customized reports, screen displays and file output. 
Processing can consist of any of a set of standard high level functions 
including record and field selection, sorting and aggregation, lookups in 
other files, special (xuocssing of record subsets, custom report 
formatting, totaling and subtoialing, and presentation of up lo three 
related files as a "database" on user defined output reports. 

XDMS-IV combines ihe functionality of many popular DBMS software 
systems wiih a new easy lo use command set inlo a single integrated 
package. We've included many new features and commands including a 
sel of general fide utilities. The processing commands arc Input-Process* 
Output (IPO) which allows almost instant implementation of a process 

XDMS-lV is session onented. Enter "XDMS" and yao arc in instant 

command of all ihe features. No more wailing for a command lo load in 
from diskl Many commands are immediate, such as CREATE (file 
definition). UPDATE (fie editor), PURGE and DELETE (utilities). 
Others arc process commands which arc used to creale a user process 
which is executed wiih a RUN command. Either may be entered into a 
"process" file which is executed by an EXECUTE statement, Processes 
may execute other processes, or themselves, either conditionally or 
unconditionally, Menus and screen prompts are easily coded, and entire 
user applications can be run without ever leaving XDMS-IV 


XDMS- 1 V keeps data management simplel Rather than design a complex 
DBMS which hides the true nature of the data, we kept XDMS-IV file 
onented. The user view of data relationships is presented in reports and 
screen output, while ihe actual daia resides in easy lo maintain fries. 
This aspect permits customized presentation and reports without 
complex redefinition of ihe database Hies and structure. XDMS-IV may 
be used for a wide range of applications from simple record 
management systems (addresses, inventoiy ,..) lo integrated database 
systems (order entiy. accounting ) 

The possibilities are unlimited... 
FOR 6609 FLEX or SK-DOS(5"/S" Disk) $249.95 

Aiftlkfclllly I Aftn*t* 
¥ - FLEX, U » UhIFLEX 
CC* - Cofef CnrnpuUi OS V 
CC? . Color Computet VUL% 

South "East Media 

5900 Cassandra Smith %f. • rtvyon, Trt. 37343 
Itltgfumt: (SIS) 842-4600 TAX (Si S) 842-7990 

•• Shipping •• 

Add 2% 1/.S.A. (mlii. &») 
F«r»Jpi Surfac* add 5% 
Koedfn Alrumll Add 10% 
Or Co<D. Shipping Otilr 

*OS-tUa Trad«mara *l Mkrnwrtiad Motor uli-'HilX *nd trnlFLEX ir«Trpiteif«rhntf 1«hnJc*l Sjiteriw C>>ihuHjiUj*«SKM>OS tn TrMfrmofhofSter-K £onw»rf System* Corp, 


August /September'89 

68 Micro Journal 

Tcfcplnmc: (61$) 842-4600 

Sou tfi 'East tMedia 

Q$-$, llnifL'EX. 'J L'LX. S'K'WS 

'fa*: (615) 842-7990 



Bask09 XRef from SE Media - This Bastc09 Cross Reference Utility it a 
Batic09 Prognm which will produce a "pretty printed" listing wiih each 
line numbcied, followed by a complete croti referenced listing of all 
variables, external procedures, and line numbers called. Also includes a 
Program Lin Uiilily which outputs a fast "pretty pi rued" listing with 
line numbers. Requiies 8asic09 or RunB. 

OS 9 <* CCO object only - SS9.95; with Source - $79.95 

BTree Routines • Complete sei of rouiino to allow simple implementation 
of keyed files -for your programs - running under Ba*ic09. A real time 
saver and should be a part of eveiy seiious piogrammers tool-box. 
OS.9 <* CCO object only - $89 95 

BASIC09 TOOLS con sin of 21 subroutines for UasicO*. 

6 were written in C Language and the remainder in assembly. 
All ihe routines are compiled down to native machine code which 
makes them fast and compact. 

I. CFILL - fills a suing with characters 
Z DPEEK -- Double peek 

3. DPOKB-- Double poke 

4. FPOS Qinxnt file position 

5. FSIZE - File sUe 

6. FfREM •• removes leading spaces from a string 

7. CETPR - returns the current process ID 
*. GETOPT - gets 32 byte option section 

9. GETUSR « gets the user ID 

10. GTIME - gets the time 

I I . INSERT - rnsen a string into another 

12. LOWER - converts a string into lowercase 

13. READY -- Checks for available input 

14. SETPRIOR - changes a process priority 

15. SETUSR - changes ihe user ID 

16. SETOPr -- set 32 byte option packet 

17. STIME sets the time 

18. SPACE - adds tpacrs lo a suing 

19. SWA P « swaps any two variables 
2a SYSCALL- system call 

2 1 . UPPER -- con vtxn a siring to uppercase 

For OS*9 . $44.95 - Includes Source Code 

FULLSCREEN FORMS DISPLAY from Computer Systems Consultants - 
TSC Extended BASIC program supports any Ser al Terminal with 
Cursor Control or Memoiy-Mapped Video Displays; substantially 
exi0«ls the capabilities of the Piogram Designer by providing a table* 
dr ven method of describing and usmg Full S cr e en Displays. 
FLEX, SKDOS and CCF. UniFLEX 525 DO, wiih Source . $50 M 

SOLVE from S.H. Media - OS 9 Uvels J and II only. A Symbolic Object/ 
Logic Verification A Examine debugger. Including inline debugging, 
disassemble and assemble- SOLVE IS THE MOST COMPLEX 
DEBUGGER wc have seen for the 6809 OS-9 scriesl SOLVE docs it 
alii With a selection of monitor, assembler, disassembler, 
environmental, execution and other miscellaneous commands, SOLVE 
is the MOST POWERFUL tool -kit item you can own! Yet, SOLVE is 
simple to use! With complete documentation, a snap) Everyone who 
has ordered this package has raved 1 Sac review - 68 Micro Journal • 
December 1985. No blind' debugging here, full screen displays, rich 
and complete in information presented. Since review in 68 Micro 
Journal, this is our fastest mover! 

Uvels I & If only - OS-9 $69.95 


OS-9 VDIsk from SE. Media - For Level 1 only. Use the Extended Memoiy 
capability of your SWTPC or Gimix CPU card (or similar format DAI) 
for FAST Program Compiles. CMD execution, high speed inier-pioccss 
communications (wiihout pipe buffers), etc. - SAVE that System 
Memory. Virtual Disk size is variable in 4K increments up u>960K. 
5<wne Assembly Required. 

Level I OS 9 object $79.95; with Source $149.95 

OF from S.E> Media - Wntiai in BASIC09 (with Source), includes: 

REFORMAT, a BASIC09 Program that leformats a chosen amount of 
an OS-9 disk to FLEX, SKDOS Format so it can be used normally by 
FLEX. SKDOS; and FLEX, a B ASIC09 Program that docs the actual 
read or wrte function to the special O-F Transfer Disk; user- friendly 
menu dr ven. Read the FLEX.SK-DOS Dircctoiy, Delete FLEX, 
SKDOS Files, Copy both directions, etc. FLEX, SKDOS users use the 
special disk just like any other FLEX. SK DOS disk 
OS 9 ♦ 6809 179.95 

LSORT from S E. Media - A SORT/MERGE package for OS 9 (Level I A II 
only). Son* records with fixed lengths or van able lengths. Allows for 
either ascending or descending sort Sorting can be done in cither ASCII 
sequence or alternate collating sequence. Right, left or no justification of 
data fields available. LSORT includes a full set of comments and errors 

OS 9 185 DO 

HIER from S.E. Media - HIER is a modern hie rare hat storage system for 
users under FLEX, SK-DOS It answers the needs of those who have 
hard disk capabilities on their systems, or many files on one disk • any 
size. Using HIER a regular (any) FLEX, SK-DOS disk (8 - 5 , hard 
disk) can have sub directories. By this method the pioblems of 
assigning unique names to files it less burdensome. Different files with 
the exact same name may be on the same disk, as iong as they are in 
different directories. For the w uichester user ihis becomes a must. Sub- 
director es are ihe modem day solution that all current laige systems use. 
Each directory looks to FLEX, SK-DOS like a regular file, except 
Ihcy have the extension \IMR* A full set of diredoiy handling 
programs are included, making the operation of HIER simple and 
straightforward. A special insult package is included to install HIER to 
your particular version of FLEX. SKDOS. Some assembly required. 
Install indicates each byte or reference change needed. Typically • 6 
byte changes in source (furnished) and one assembly of HIER is all that 
is requiied. No programming required! 
FLEX . SKDOS $79.95 

COPYMULT from S.E. Media - Copy LARGE Disks to several smaller 
disks. FLEX. SKDOS utilities allow the backup of ANY size disk to 
any SMALLER size diskettes (Hard Disk to floj^ies, 8" to 5", etc.) by 
simply inserting diskettes as requested by COPYMULT. No fooling 
with dircctoiy deletions, etc. COPYMULT.CMD understands norma] 
"copy" syntax and keeps up with files copied by maintaining directories 
for both host and receiving disk system, Also includes HACKUP.CMD 
to download any sue "random" type file: RESTORE.CMD to restructure 
copied "random" files for copying, or recopying back to the host system; 
and FREELINK.CMD as a "bonus" utility that "relinks" the free chain of 
floppy or hard disk, eliminating fragmentation. 

Completely documented Assembly language Source files included. ALL 4 
frograms (FLEX. SKDOS, 8" or 5') $9950 

O • OS-9. S - SK'DOS 
CCi - Gofer Genpaur OS-t 
OCy - Cpfer Cwrtsmifr TLZX 

South "East Media 

5900 Cassandra Smith %&„ - tfuyoii, Tru 3 7343 
Telephone: (61 5) 842 4600 7XX (SIS) 842- 7990 


•• Shipping ♦♦ 

A66 2% VSJL tmU. X15S> 
For* ifP AAramU A*0 U% 
Or C.O.B. ShippyniOnlf 

*OS-f b* TfditMrtt of Mterw»rt md M^.moL. 'FLEX *m4 IMffUEX arr Trad—n 

rfcurfTfhnkjl SyiUrrn CM»llaDtfr*SK»DQS H* Trtdrarfc of Stor-tt Sonwt Sutiiw Cor* 

68 Micro Journal 

August /September'69 


Ttkphont: (615)842-4600 SoUtfl 'EOSt Media 

0$-9, 'Uni'JL'EX, JLEX, S^CDQS 

'Ja\" (615) 842-7990 

VIRTUAL TERMINAL from S.K. Media « Allows one terminal 10 do the 
work of several. The user may start as many as eight tasks on one 
terminal, under V/RWALTERMJNAL and switch back and fonh 
betwfo) talks at will. No need to exit each one; just jump back and forth. 
Complete with configuration program. The best way to keep up with 
those background programs. 

6809 OS-9 ± OCO - object only - $49.95 

FLEX, SK-DOS DISK UTILITIES from Compiler Systems Consultants - 
Eight (8) different Assembly Language (with Source Code) FLEX, 
SK-DOS Utilities for eveiy FLEX, SK-DOS Users Toolbox: Copy a File 
with CRC Errors; Test Disk for cirors; Compare two Disks: a fast Disk 
Backup Program; Edit Disk Sectors; Linearize Fme-Cnain on ihe Disk; 
print Disk Identification; and Sort and Replace the Disk Directoiy (in 
sorted order). - PLUS - Ten XBASIC Programs including; A BASIC 
Rescquenccr with EXTRAs over "RKNUM" like check for missing label 
definitions, processes Disk to Disk msiead of in Memory, etc. Other 
programs Compare, Merge, or Generate Updates between two BASIC 
Programs, check BASIC Sequence Numbers, compare two un sequenced 
files, and 5 Programs for establishing a Master Directory of several 
Disks, and sorting, selecting, updating, and printing paginated listings of 
these files. A BASIC Cross Reference Program, written in Assembly 
Language, which provides an X-Kcf Listing of the Vaiiables and 
BASIC Programs. 

ALL Utilities include Source (either BASIC or AL, Source Code), 
FLEX. SKDOS and CCF • $5000 
BASIC Utilities ONLY for UniFLEX - $30.00 

MS-DOS lo FLEX Transfer Utilities to OS-9 For 6BXXX and CCOS-9 
MS-DOS Disk. These Utilities come with a rich set of options allowing 
the transfer of text type files fromAo FUiX A MS DOS disks. "CoCo 
systems lequire the D.P. Johnson SDISK utilities and OS-9 and two 
drives of which one must be a "host" floppy. 

•CoCo Version: $69 95 6SXXX Version $99 95 


TABULA RASA SPREADSHEET from Computer Systems Consultants - 
TABULA RASA is similar to DESKTOP/PLAN; provides uscof tabular 
tornpuiaiion schemes used for analysis of business, sales, and economic 
conditions. Menu-driven; extensive report-generation capabilities. 
Requires TSCs Extended BASIC. 

FLEX. SKDOS and CCF. UniFLEX- $50 00, wan Source . $100 00 
DYNACALC « Electronic Spread Sheet for the 6809 and 68000. 
UniFLEX- $395.00. FLEX, SKDOS. OS 9 and SPECIAL CCF * $250.00 
OS-9 6BK - $299.00 

FULLSCREEN INVENTORY/MRP from Computer Systems Consultants 

Use the Full Scrcoi Inventory System/Matenals Requirement Planning 
for maintaining invcntoiies. Keeps item field file in alphabetical order 
for easier inquiiy. Locale and/or pnnt records matching partial or 
complete item, description, vendor, or attributes; find backorder or below 
stock I c veil. Print-outs in item or vendor order. MRP capability for the 
maintenance and analysis of Hierarchical ai&cmblies of items in the 
inventory file. Requires TSCs Extended BASIC. 
FLEX, SKDOS and CCF. UniFLEX - $50.00. with Source - $100.00 

FULL SCREEN MAILING LIST from Computer Systems Consultants » 
'Ihe Full Screen Mailing ListSysiem provides a means of maintaining 
simple mailing lists. Locale all records matching on partial or complete 
name, city, state, zip, or attributes for Listings or Labcb. etc. Requires 
TSCs Extended BASIC. 
FLEX. SK DOS and CCF. UniFLEX* $50.00. with Source - $100.00 

D1ET-TRAC Foiecasler from &.E. Media - An XB ASICprogram that plans 
a diet in terms of either calones and percentage of carbohydrates, 
proteins and fats (C P G%) or grams of Cat boh yd rate. Protein and Fat 
food exchanges of each of the six basic food groups (vegetable, bread, 
meat. skim milk, fruit and fat) for a specific individual. Sex, Age, 
Height, Present Weight. Frame Size, Activity Ixvcl and Basal Metabolic 
Rule for normal individual arc taken into account. Ideal weight and 
sustaining calorics for any weight of the above individual aic calculated. 
Provides number of days and daily calendar after weight goal and calorie 
plan js determined. 

FLEX. SKDOS - $59 95. UniFLEX * $69 95 


RAPIER - 6809 Chess Program from SE. Media - Requires FLEX. 

SK-DOS and Displays on Any Type Terminal, Features: Four levels of 
play. Swapside. Point sconng sy*iem. Two display boards. Change 
skill level. Solve Checkmate problems in 1-2-3-4 moves. Make move 
and swap sides. Play white or black. This is one of Ihe strongest 
CHESS programs running on any microcomputer, estimated USCF 
Rating 1600+ (better than most 'club' players at higher lewis) 
FLEX, SKDOS and CCF * $79 95 

MS-DOS and Macintosh 

Software at Discounted Prices 

"Call for prices, ii"fl be worth the savings" 

(615) 842-4600 
FAX (615)842-7990 

o - m-f, s - sit -oos 

O09 - Ctfv CooPultr Q&-f 
CCF • Cmtor CompyUr PIXX 

South "East Media 

5900 Cassandra Smith Itf. - tHi^On, 7k 37343 
Tettpfone: (61$) 842 4600 9XX (61$) 842> 7990 

flMUi'f card 

•• Shipping •• 

A 44 1% USA, <■!■, $L$i) 
Fortes WW* A 44 3% 
Porriffl A I mm 11 A44 1»% 
Or COD Shlpploi Only 

♦OS.HfTwJfwfcof Mkwf»r«a n4 Mmnf&b'rl.KX »nd UniKLKX »rt Truhmirkmf T*hnk*l SjtUim t^niwHirm *»AK*IHW lit TrwUrnrkgrSUr K Wl»«r» Sj»Uim lj»rp, 


August /September 69 

68 Micro JoumaJ 

Word Processor 


Time Manager 

The SmanWare word processor was designed 10 make writing easy. It permits 
concurrent display or "cut-and-paste" operations from one document to another 
using up to 50 different windows. The word processor can be used to write a basic 
business letter, yet provides sophisticated features necessary to create complex 
technical documentation. Text manipulation features include footnoting, headers 
and footers, alphabetized lists, auto-hyphenation and spelling checker. 

The word processor enhances personal productivity by simplifying text creation/ 
editing and customizing documents. And as text is inserted or deleted, paragraphs 
are reformatted automatically. Distribution list mailings and individualized forms 
can be produced using the merge command. 

Hardcopy output can be printed in 12 different fonts (depending on printer 
support). Other printer functions such as underline, boldface, etc. may also be 
supported. Graphs created using the spreadsheet module can be embedded in 
printed documents. Printer control codes allow configuration of unsupported 

Transmission and reception of files from another computer is facilitated by using 
the Communication Module. When using a modem, files can be transmitted 
between remote sites as text or using the Xmodem protocol. Data can be easily 
coordinated and shared by multiple systems at various locations. Password 
protection is available to secure data against unauthoiized access. 

Meetings and appointments can be scheduled using the Time Manager module. 
This automatic calendar/diary can maintain itineraries for individuals or functions. 
Thirteen commands aie available and a status line displays the time, date and 
current file name. A description of up to 25 characters can be displayed in the 
"meetings" window of the day screen. The "week" or "month" screen displays a 
schedule with markers indicating meetings or appointments. 


Business Functions 
Input Functions 
Numeric Functions 
Statistical Functions 
Test Functions 
Transcendental Functions 
Variable Functions 

Date Functions 

Logic Functions 

Random Functions 

Statistical Data Base Functions 

Time Functions 

Trigonometric Functions 

Miscellaneous Functions 




68 Micro Journal 

August /Soptembef'69 



A Tutorial Series 

By : Ronald W Anderson 
3540 Sturbridge Court 
Ann Arbor, MI 48105 


From Basic Assembler to HLL's 


6809 and 68000 Compared 

After a lot of work, there are now two current versions 
of the editor PAT. First is the new SK*DOS version 
written in Whimsical, and second the 6809 version 
freshly updated to do everything the other version does. 
It is written in my old favorite PL9. The two versions 
work just about identically. The final object code byte 
count and some statistics about them may be interesting 
to most of you. The 6809 version is 18,148 bytes and 
the 68K version is 19,800 bytes. The difference is just 
about 9%. The 68K version can edit a much larger file. 
The other night when the 5 1 2K memory expansion for 
the PT68k-2 arrived, I made the edit buffer 500,000 
bytes and found that it still worked fine. Of course 
addressing any range greater than 65 K requires a larger 
address. That is, the address must be greater than 16 
bits. Therefore one would expect that more code would 
be required to do the same functions. Perhaps the 
interesting thing is the code generated per line of source 
code. The 6809 compiler PL9 generated 6.39 bytes per 
line and the 68000 compiler. Whimsical 6.55 bytes. 
The line counts include blank lines between procedures 
and comment lines. The bytes per page count is 363 for 
the 6809 version and 375 for the 68K version. 

More on Assembler 

I've been spending some time trying to write some 
utilities a little beyond the single pagers that we all start 
out with. Last month's ADDRESS utility was just a 
little larger, so it qualified. Let me urge you SK*DOS 
users to sitdownandTRY writing a few little programs. 
Theie have been examples here in this column and 
others. What brought this on is the arrival of Motorola's 
68000 Audio Cassette course which they are presently 

offering for $125. It is about 4 1/2 hours of cassette 
lecture with extensive notes in sort of a workbook, I 
was primarily interested in learning more about the 
hardware end of the 68000 and along with that, some of 
the more advanced topics such as exception processing 
and interrupt handling. The course arrived a couple of 
days ago and I've gotten to the half way point. It is 
nicely done but it strikes me that it sounds incredibly 
detailed and complicated just listening to it, but it is not 
nearly that hard to understand when you launch out and 
start using it. 

I had started reading books on "Programming the 
68000" three or four years before I had a 68000 based 
system in front of me. I never got very far with the book 
because I got lost in detail and had to pinch myself to 
stay awake trying to read through the addressing modes 
and the instruction set. I was very familiar with the 
6809 but this looked so different that I would never be 
able to grasp it (I thought). Honestly, with the SK*DOS 
manual (read it first) and the Motorola 68000 User's 
Manual (ditto), it took a very short time to see that the 
instruction set and the notation used is quite straightfor- 

I don't claim to be an expert assembler programmer 
with a 68000 yet, but I can write programs and make 
them work with a lot less effort than it took to get the 
first 6800 and 6809 programs running. Of course some 
of that is attributable to experience at assembler pro- 
gramming and/or debugging programs in general, but 
certainly a good pait of it is the simplicity of the 
structure of the instruction set. The instructions are 
uniform and behave as you would expect them to 


August /September'89 

66 Mcro Journal 

behave. If you tiy to use an instruction that is not 
implemented (i.e. an addressing mode that is not legal 
for the particular instruction) the assembler flags the 
error and you refer to the User's Guide and figure out 
another way to do the desired function. 

There are a few things that are not nice about the 
68000. The designers made a decision for us as pro- 
grammers that any data that is imbedded in the program 
code must be a constant and can only be read via pc 
relative addressing. That is, if you have a program 
followed by a couple of DC.W declarations to set aside 
space for a variable, you can do the following: 

move.w var(pc) f D0 

That is, you can read data from the location var(pc). 
Pc counter relative addressing mode is used and the 
value is moved to DO in the above example. Now you 
can change the value in DO but you can't write it back 
as below 

move.w d0,var(pc) 

This is not a legal instruction in the 68000 unfortu- 
nately. It takes two instructions to put the value back 
into the variable. 

lea var(pc),An 
move.w D0,(An) 

That is, you have to load the pc relative address of the 
variable into an address register (any of them that is not 
being used for another purpose) and then move the data 
via an indirect addressing access. It is too bad, but the 
designers decided that all data (i.e. variables) for a 
program should reside in another block of memoiy 
somewhere. Indeed the hardware of the 68000 is set up 
so that the user can decode the three function code lines 
and prohibit writing to the program section of memory, 
allowing writing only to the Data section. Peripheral 
Technology has chosen not to do this, and programs 
written to run under SK*DOS, though they must be 
position independent, can put the variables justafterthe 
program code (or before it, or within it, between sub- 
routines or after an unconditional branch to elsewhere). 
The only complication is that you have to use two 
instructions to write to a variable as outlined above. 

Modula-2 for SK'DOS 

A week ago, a package arrived in my mail. It turned 
out to be a complete Modula-2 compiler implemented 
for SK*DOS 68K by Mike Randall of Wellington New 
Zealand. Mike said that his effort was about complete 
and ready for some serious testing so he had sent me a 
copy to try. Since I have been a fan of Pascal and its 
derivatives I would have been happy with a Modula-2 
compiler to run on ANY computer. Having one for the 
68K system was almost too much to bear. The docu- 
mentation was primarily the specifics of the implemen- 
tation and they stated that they are not a tutorial on 

Mike recommended two books on the subject, the 
first by Professor Niklaus Wirth. We had obtained 
Winh's own book on Pascal several years ago from a 
publisher in Switzerland. It took a couple of months to 
get one. I went to the local shopping mall which has 
both a B. Daltons and a Walden Books store. Though 

1 found several feet of shelves in both stores devoted to 
running AutoCad, or how to use Lotus 1 2 3, and 
surprisingly, about 6 feet of books on "C\ I found NO 
books on Modula-2 in either store. The package had 
arrived on Saturday and I had managed to get to the 
bookstores on Sunday. 

1 figured my only hope would beone ofthe bookstores 
on the campus of the University of Michigan. (Living 
in a University town has its advantages at times). It was 
Tuesday before 1 found the time to call the bookstore 
and inquire about Modula-2 books. I was told that there 
were FOUR different books in stock. I chose "Modula- 

2 Made Easy" by Herbert Schildt, published by 
Osborne / McGraw Hill. 

That night I set out to read the book, and by the time 
I had gotten a few chapters into it, 1 ran the compiler to 
compile a first program. It worked right off, and I was 
impressed with how close to the "standard" the com- 
piler is. Over the next few days I found a couple of 
minor bugs which have been reported to Mike by 
International Express Mail. 1 managed to get my 
scientific functions package translated into a Modula-2 

68 Micro Journal 

August /Sepiember'89 


Let me give you some first impressions of Modula-2. 
First of all, I was impressed, no, actually I was more 
amused at how much Professor Winh was influenced 
by "C". Pascal was a language written to teach students 
how to program properly. As such it was done in the 
days of batch processing and it lacked any standard way 
to access disk files. The details of that were left to the 
implementors of Pascal, and therefore each Pascal 
compiler had a little different flavor when it came to file 
handling. Appaiently Professor Winh liked the idea of 
a ''standard library" as used in "C\ so he left all the 
system dependent things like file accesses out of the 
language proper, and put them into a "standard library". 
Some of the modules in the library are "Terminal", 
which contains character and string input and output 
routines; InOut which contains those plus file opening, 
closing, read, write; RealConversions, containing 
RealToString, and StringToReal conversions; Reall- 
nOut, containing ReadReal, WriteReal, and for some 
reason WiiteRealOct, a procedure for writing a real 
number out in Octal. I replaced that with a WriteRe- 
alHex, essentially rewriting that module for myself. 
There are several others, but you get the idea. When 
your program or module needs to use one of these, you 
"IMPORT' one with a statement like: 


When you import a procedure from any module, that 
whole module gets linked in as part of your program. 
Some of the modules link in other modules necessary 
for their operation. I wrote a three line program ap- 
proximately as follows: 

WriteString("Hi theie"); 
number := 2*Pl; 

Remember that I had written my own WriteReal, and 
it is a little different than the standard library version, 
but made to be more like the Pascal version with regard 
to the field specification for the number format. At any 
rate, I imported WriteString and WriteLn from InOut 
library, and that "dragged in" all the file handling 
procedures which I didn't need. WriteReal was im- 
ported from Reallnout which loads RealConversions. 

All in all, I had 68 sectors of code, about 17 K for that 
four line piogram. I wasn't very impressed. Then I 
found that WriteString and WriteLn were also in the 
Terminal library, and that didn't pull in all the file 
handling procedures. I made the change and recom- 
piled and linked the program and found that I now had 
36 sectors of code. 

I tried an equivalent program in "C" using printf() to 
print the suing and the number, and the program was 26 
sectors long. I tried the same in Whimsical and I got 6 
sectors of output code. 

I was puzzled at the seeming inefficiency of code 
generation when it dawned on me that both "C" and 
Modula-2 were pulling in whole libraries for the need of 
one function. Whimsical has the in/out functions built 
into the compiler as separate subroutines that are in- 
cluded if needed. You don't get any more code than you 

I can do something about the problem in Modula-2 
simply by getting my hands on the source code for the 
libraries. It sounds as though they might be described 
in Professor Wirth's book. The libraries could be split 
up in such a way as to allow importing only code that is 
needed. I expect the efficiency of code generation 
would go up considerably at the expense of having a 
library of standard procedure modules, a large number 
of them, requiring a lot of bookkeepping to get them all 

After some thought, I have a question for all the 
compiler designers and writers out there reading this 
(all two or three of you, that is). "C" in my mind 
generates an outrageous amount of object code for a 
simple program. Now I think I understand why. "C" 
generates Assembler source code. Why couldn't an 
optimizer be written that would operate on the assem- 
bler source code to eliminate all code that is never run 
in a program. Any complete unit of code, (something 
that starts after an unconditional branch or RTS instruc- 
tion) with an entry label that is not leferenced anywhere 
else in the program, down to an RTS or label that IS 
referenced somewhere else in the program, or the 
program end, could be deleted from the assembler 
source code simply by deleting such sections. The fact 
that the program uses labels at that point rather than 


August /September '89 

68 Micro Journal 

offsets or absolute addresses, would mean that such 
code could simply be deleted and the remaining code, 
all of which is executed by the program, would still 
assemble correctly. 

Oh, I realize at least in the case of the "C" compiler 
that the whole assembler source file is not pulled 
together as the output of the compiler. There are lots of 
"lib" references in the output file, but those portions of 
code COULD all be pulled into one big file that could 
then be handled as above. I tried my hand at it manually 
and soon discovered that it was too hard to keep track of 
labels manually , and that it was really easy todelete one 
line too many so the program wouldn't compile. 

In the case of my tests above, about 85% of the first 
Modula program and about 70% of the "C" program 
was code that was never run. Wouldn't it make more 
sense to work on an optimizer that would remove code 
that is never used by the program than to make an 
optimizerthat simply removes consecutive instructions 

MOVE.W D0,(A0) 

This trio simply stores the contents of DO and reads it 
back from memory, and the removal of such instruc- 
tions is typical of what most optimizers do. The 
optimizer might assume that the contents of DO need to 
be stored in the variable, but they are already in DO by 
the third instruction, so that can be deleted. By actual 
test, the optimizer pass of the OS9 Microware "C" 
compiler reduces the code by some 3% or so. One that 
removed non-accessed code could reduce the program 
size by 75% or more in some cases. 

I should point out here that my test program is really 
a worst case. 1 purposely used string and REAL 
functions so there would be a couple of diverse I/O 
routines included in the program code. In practice with 
non-trivial programs, you would almost surely use 
more of the library functions that were included, and the 
code that you write, of course would expand while the 
library code would not. The differences would be 
smaller percentages than with the very simple program. 

Actually, the optimizer idea could be made to work on 
binary object files too by disassembling them, optimiz- 
ing and then re assembling them, but there would have 
to be a lot of careful work done identifying data tables 
and making sure the disassembler didn't generate inva- 
lid labels. 

The optimizer would have to make multiple passes 
because eliminating unreferenced code might elimi- 
nate references to other code which could be eliminated 
on another pass etc. The program would have to run 
until the program got no smaller on a pass. It could be 
a fairly long process, but then as with all optimization 
programs, it wouldn't have to be run until after a 
program or module is debugged. Am I dreaming or is 
all this possible? Or would it be much simpler to have 
a smarter compiler or linker that could link in only 
procedures that are referenced? Or have I lost all of 

Well, anyway, Modula-2 looks like a nice language. 
Like Pascal it is restrictive, particularly with regard to 
variable typing. However, unlike Pascal it has a SYS- 
TEM library with some variable type definitions that 
make life easier when you want to "bit fiddle*'. That is, 
if you want to get in at a very low level and manipulate 
bits as in a math operation. In the scientific function 
calculations, it turns out that a great improvement in 
their execution time and accuracy of the results can be 
obtained if one can get into a REAL number and extract 
and manipulate the exponent. (A simple example 
would be to divide the exponent of a number by 2 to get 
a fair first guess as to its square root, and then use 
Newton's method to refine it. As you might imagine, 
manipulating the exponent is crucial to EXP and LOG 
functions as well. I was able, using the SYSTEM 
functions and variable definitions, to write procedures 
to extract the exponent of a real number, and to put an 
exponent into a real number to replace the existing one. 
Once those were done, the scientific function package 
was easy to implement. 

The caution about using things from the SYSTEM 
library is that the code now might not be portable to 
another system running a different modula-2 compiler. 
Actually, the code that I wrote would run in another 
system with a different compiler only if the REAL 
number representation were the same. However, at 

68 Micro Journal 

Aug jst /September'89 


times it is worth making the program non-portable for 
an improvement in perfoimance. The two procedures 
in question could be commented well to show what they 
did, and the "porter" would have to rewrite them to 
work with a different number representation. 

More Modula-2 

As Gomer Pyle used to say, "well Gahhhhh-ley" It 
seems that I am about a compiler generation late. I've 
spent a couple of weeks getting my thinking switched 
around from Pascal to Modula-2 (I skipped right past 
Modula, and Algol was before my time in computing), 
and now I find that Professor Wirth has said that 
Modula-2 is obsolete. See Bud Pass' column in the 
Aprir68' Micro Journal forthe update, l'mnot kidding 
at all, I did write the above discussion of Modula-2 
BEFORE I saw Bud's article. I certainly did smile at his 
mention of how Wirth is coming around to writing 
compilers that look more and more like "C". That 
observation certainly is in line with what I said above. 

Of course computers have changed in character a 
great deal since the days when Pascal was written, so of 
course the philosophy of programming must change 
also. Modula-2 fixed the problems with Pascal in the 
area of defining file handling procedure and a number 
of other places. To my thinking, it became a practical 
language to apply to real world applications other than 
pure computer science research and running database 
software on mainframes. As I just mentioned above, 
Modula-2 had a real way to get at the hardware. The 
absence of that facility in Pascal is probably its greatest 
drawback with ielation to "C\ S ure, a i4 C" program can 
be very portable, but if a programmer wants to get to the 
hardware, he can do it very easily with a pointer. 
Modula-2 added that possibility with the type defini- 
tions and operations in its SYSTEM library. 

Now Professor Wirth has decided that the language 
was contaminated by those facilities because they al- 
lowed a user to write non-poitable code, and therefore 
has thrown them out in his newest creation Hennion. 
Professor Wirth, wake up. Look around. Where are 
computers going? Our house has a microprocessor 
based microwave oven. Two of our cars are controlled 
by at least one microprocessor, probably more like two 
or three. The gas range has one, though a simple one. 

in its timer and control section. The video cassette 
recorder has one so that it can be programmed to select 
a channel at any time within the next two weeks and 
record a program unattended. My wife has a computer 
controlled sewing machine that can do many fancy 
stitches and even machine embroider names or initials 
in two or three different font styles. A friend of mine, 
one morning, pulled into a gas station but couldn't buy 
gasoline because "our computer is down". The comer 
video rental store uses barcode readers to read the video 
cassette labels and the customer's "membership card", 
and a computer prints out the sales ticket. The super- 
market reads bar codes on packages with a laser bar 
code reader and the computer totals the bill, printing an 
itemized list of the articles purchased and their prices. 

That only is a small list of the commercial use of 
computerchips. The industrial uses have taken off also, 
A whole class of programmable controllers has re- 
placed relays in machine control applications. Several 
months ago one afternoon 1 was beginning to debug 
some software in a large machine. I was pushing the 
"jog" button on a large control panel and trying to get a 
servo motor to turn a fraction of a revolution each time 
the button was pressed. It occurred to me rather 
suddenly that there were three computers between the 
push button and the servo motor. The control panel was 
being scanned by an Allen Bradley PLC, a program- 
mable controller that is programmed in terms of "ladder 
logic" the symbolism used by relay control logic de- 
signers for many years. That programmer contains a 
microprocessor. It was scanning inputs and seeing the 
contact that I was closing by pushing the button. It 
performed some logic and output a signal to the 6809 
computer supplied by my company as part of the 
machine. The 6809 computer responded to the signal 
from the PLC by generating an ascii string of characters 
output on a serial port to tell a servo motor controller to 
turn the servo motor 1/10 revolution clockwise. If all 
went well, the servo controller did that and sent an ascii 
string back to the 6809 to say that the command had 
been executed. The 6809 software contained a timing 
loop so that if the servo controller didn't respond in a 
timely manner, the screen of the computer display 
indicated Servo Controller Not Responding or some 
such error message. 


August /Septembers 

68 Micro Journal 

Admittedly, the computers involved are small, but 
there is a lot of software there, and those three comput- 
ers all had to be programmed by someone. There was 
a lot of hardwaie interfaced to each of the computers 
also. Two of them had no standard input or output 
devices connected to them. One had a CRT monitor. 

The point is that far more computers are finding their 
way into dedicated applications like these with hard- 
ware interfaces involved than into traditional comput- 
ers these days. Are the programmers of all these 
applications forever to be forced to program in Assem- 
bler for the sake of the purity and portability of a 
computer language? Ask the programmer of the Pfaff 
sewing machine's computer if he cares whether or not 
the code is portable, and he will probably say that he 
certainly does care, the less portable the code the less 
likely a competitor is to "port** it over to another 

Modula-2 solved the problem to a large extent, 
though access is still a bit awkward. Purists writing 
code for computer systems can choose not to use 
SYSTEM, and thereby maintain the portability of their 
code, which is a great advantage in broadening their 

Those of us who are writing programs to run hardware 
for industrial control or automotive applications are 
looking for efficient code and easy interface to hard- 
ware. Give us a way to declare a variable AT an address 
and further to declare a real, a long word, two words, 
and four bytes all at the same address. One can write a 
"pure" squaie root routine, but it can be done in such a 
way as to run much faster by extracting the exponent 
byte of a real variable, manipulating it and reinserting 
it. Take all of our shortcuts away from us and we will 
all flock to something else in the way of a language, for 
example, my favorite so far for the 68000 system, called 
Whimsical Whimsical lets me get at the bytes of a real 

number. It uses an IEEE real number representation in 
which the high order bit is the sign of the mantissa, the 
next 8 bits are the 2*s complement exponent with an 
offset of 127, and the remaining 24 bits (the high order 
bit of the mantissa is assumed always to be a 1 since 
numbers are stored as binary fractions normalized so 
that the highest order bit is always 1), are the mantissa. 
It therefore is "hidden" under the least significant bit of 
the exponent. 

To get the exponent one has to grab the high order 
WORD of the REAL, shift it left once, and take the high 
order BYTE of that. Whimsical has the type 
SHORTINT which is a signed 8 bit integer, that just fits 
the exponent value range. The exponent can be ex- 
tracted simply by: 



Whimsical uses typed procedures (as "Cdoes). The 
procedure is passed a real number as a parameter. The 
procedure shifts the high order word (WORD[ 1 1) of the 
real number one place left. It takes off the top byte 
(B YTE[ 1 1) which is the exponent, subtracts $7F from it 
(the types BYTE and WORD are compatible with 
Hexadecimal values). It is then convened to the signed 
SHORTINT type and returned to the calling procedure. 
Inserting an exponent in a REAL is a little more com- 
plex, but not much. Those two functions are the basis 
for a scientific function package. 

I don't suppose there is much chance that Professor 
Wirth will ever see this discussion, but I'd be interested 
in his thinking on the subject if he does. 




68 Moo Journal 

August /September 89 



A Tutorial Series 

By: R. D. Lurie 
9 Linda Street 
Leominister, MA 01453 


Starting with this column, I will be spending most of my 
time with OS-9 and FORTH09, instead of FLEX and 
FF9. This does not represent a conviction that there is 
something wrong with either FLEX orFF9, but, rather, 
a bowing to the inevitability of OS-9! However, I don't 
plan to abandon all of you who have been with me over 
the last twoyears, since I expect thatmostof what I have 
to say will still be relevant to any sort of FORTH, at 
least, I hope so. Furthermore, I hope that this shift 
toward a greateremphasis on OS-9 will be of some use 
to the 68000 community, even though I do not have a 
68000 machine. This change in emphasis was made 
possible by the introduction of FORTH09, a product 
from D. P. Johnson. I don't want to repeat my review of 
FORTH09 which appeared in the January, 1989, issue 
of 68' Micro Journal, but I do want to say that Dan has 
done an excellent job of fixing the few bugs that anyone 
has been able to find in it, and I can give it an unequivo- 
cal recommendation. Since it works with Level I or 
Level 11 OS-9, just aboutanyone with a 6809 can use it, 
so I have no qualms on that score. Furthermore, I 
understand that Dan is working on a 68000 version of 

In fact, I am so pleased with FORTH09 that I have quit 
work on my C3 FORTH for the CoCo3, since I no longer 
need it. 


I never thought that I would be offering a patch for OS- 
9, even one as simple as this, but here it is. 

1 cc3io 
c05ac 18 Id 

This patch is called by modpatch from my startup file. 
It changes the shifted-left-arrow from CAN ( A X) to the 
harmless GS ( A =). I needed this change because I was 
continually fouling up with the FORTH09 editor when 
I reached for the shifted-right-airow, which functions 
as the TAB key. CAN erases the current line, so you can 
imagine my frustration and language when I acciden- 
tally hit the wrong key! 

Output Directly to a Text File 

I thought that I would show off a few features of 
FORTH09 by presenting screens 0-7, which were 
printed with QLdirectly into a text file by a variation on 
the technique used in XFRS+. QL is a part of a screen 
file named"forth. list" and XFRS+ is part of a screen file 
named "forth. xfr". The command lines were: 


0" ql.list" >PATH 3 QL >SCREEN 


0" ql.list" >PATH+ 3 QL >SCREEN 

The first command switches to "forth.list" on /d0. The 
second line opens a new file named "ql.list" on the 
current working directory, which happens to be /d 1, but 
it could be anything. The "forth.list" file is then written 
to "ql.list" by QL, and >SCREEN switches output back 


August /September^ 

68 Micro Journal 

to the terminal, which happens to be /wl. The third 
command switches to "forth.xfr" on /dO. This time, the 
last line opens the old file named "ql.list" and uses QL 
to add its output onto the text already in the file. (Later, 
I used the OS-9 editor to rationalize the screen numbers 
so that they would be easier to talk about.) 

Explanation of "forth. lisf: 

The first thing to notice is the listing of Screen #0. QL 
did the expected and chopped off the unnecessaiy lines 
8-15. However, 1 did want to keep the "blank" line #1, 
just to make the screen easier to read. Therefore, I put 
a\ way out toward the end of the line where i t would be 
out of the way, but still would force the line to be 
printed. I used this Dick in all of the screens where it was 
appropriate. Remember, this is nothing but a space- 
filler and has no effect on the compilation of the screen. 

Line #0 of Screen #1 is particularly important! You will 
remember in my review of FORTH09 that I mentioned 
the existence of a PRIMARY and a SECONDARY 
dictionary. SECONDARY definitions can use PRI- 
MARY words, but not the other way around. Therefore, 
since the next few screens contain words from the 
SECONDARY dictionary, they should, themselves, be 
put in the SECONDARY dictionary. (There are excep- 
tions to this, and I will discuss them later.) In any case, 
I took the first possible opportunity to select the proper 
dictionary for the following definitions. This selection 
holds until it is explicitly changed. 

The first definition on the screen uses the OS-9 utility 
to print the current date and time, using the SHELL 
command. SHELL causes the OS-9 shell to execute the 
command string initiated by CR" and ended by " . 
SHELL can be used to execute any legitimate OS-9 
command from within a FORTH09 program, so it 
cheerfully allows you to crash the system if you are not 
paying attention! As they say in the monster movies, 
"You have been warned!** 

The definition of CLS is routine, but the use of EQU in 
Line #8 todefine FF (form feed) is unique to FORTH09, 
asfar as I know. EQU creates a synonym using the same 
execution code for both words, thereby potentially 
saving a lot of RAM. By the way, EQU is the SECON- 

DARY word I was anticipating in Line #0 of this same 

You may wonder why I wrote a new definition of list, 
since there was a perfectly serviceable one already 
provided with FORTH09. Well, there were two rea- 
sons. In the first place, I tend to accumulate listings of 
the same screens as 1 edit them without ever bothering 
to throw the old ones away. Mainly, this helps me to 
return to the old form of a definition if I find that I have 
b#en working down the wrong path; therefore, I need 
the date and time stamp on the listing so that I can keep 
them in the proper order. Furthermore, I really do have 
trouble following a nearly blank line across the screen 
or the page to where the number is listed, so that the 
supplied version of LIST was giving me some trouble 
in identifying line numbers; my eyes just aint what they 
used to be! There is nothing notable about this defini- 
tion, so I won't spend more time on it. 

On the other hand, .TRIO resolves a pet peeve with the 
utility commonly known as TRIAD . TRIO lets me 
start printing with any screen number, while TRIAD 
requires that the first screen number be divisible by 3. 
Far be it from me to argue with people who are so well 
organized that their listings always begin with the 
proper screen number for TRIAD , but I am not nearly 
so well organized. I think that TRIAD appears only in 
FIG-FORTH, but others may have also had my trouble. 
In any case, .TRIO is not a particularly remarkable 
definition, so I will go on. 

The definition of QL in Screen #3 is pretty much as I 
have shown it before, except for the use of .DATE-T . 
Notice that this definition uses nested loops, which 
means that the counter for the outer loop is called J and 
the counter f orthe inner loop is called I . The IF . .. ELSE 
... THEN statement in lines 7- 10 determine whether or 
not there is any text on a line; therefore, whether or noc 
it should be printed. 

Explanation of "forth. xfr": 

Screen #4 introduces the "forth. xfr" listing, and is 
normally identified as Screen #0. 

Line #2 of Screen #5 has an interesting feature unique 
to FORTH09. About half way across the screen is the 

SS Mcro Journal 

August /Septefflber*69 


command REMEMBER XF . This puts a marker into 
the dictionary so that later typing of XF as a command 
will cause XF and all following words to be dropped 
from the dictionary. It is a convenient way to clear 
clutter fiom the dictionary after it is no longer needed. 

XFR+ attaches a single block to the end of an existing 
file. The entry parameters are set up for the convenience 
of the operator, in that they follow the FORTH conven- 
tion of "from" as the first parameter and "to" as the 
second parameter. SCRN is a VAR which is identical to 
the VARIABLE SCR ; they even use the same storage 
bytes. The phrase TO SCRN is the way the scr#en 
numberi s stored in SCRN ; either the word SCRN or the 
phrase SCR @ would produce the same value on the 
Data Stack. When I wiote this definition, and the 
following two, 1 was too lazy to juggle the values on the 
Data Stack, so 1 settled for storage in a VAR instead. 
This simplified the programming so much that 1 think 
that I just had a revelation; namely, don't use the Data 
Stack in situations where variable storage would be 
easier! Why did it take me so long to see this? 

XFRS+ is simply a looping structure containing XFR+ 
. Again, the parameter order follows FORTH conven- 
tion of "from", "to", and "count". The VAR named 
ADR (line #2) is used to store the pointer to the string 
so that 1 did not have to worry about keeping the Data 
Stack untangled. Line #8 prints the number of the next 
screen to be transfeired, so that 1 can keep track of the 
progress of the operation. The name simply means 
"XFR Several". 

XFR docs the same thing as XFR+ , except that it also 
creates the file. As a result, only one block can be 
transferred to a new file using this scheme; all further 
blocks must be transferred with XFR+ or XFRS+ . 

1 use these words to transfer definitions from my 
"general purpose definitions" file, rather than have to 
retype them each time I n#ed to reuse a particular block. 


Recently, I have been experimenting with the conver- 
sion of some engineering programs originally written in 
BASIC into FORTH. There is really no problem with 
converting most of the program, but the math opera- 
tions kill the whole project. 

I have found that, most FORTH programming experts 
to the contrary, many engineering calculations need the 
flexibility of floating point. Even with 64-bit interme- 
diate products, integer math is just too much of a hassle 
to be worth the effort! 1 will grant that any calculations 
can be done in integer math, if you know what range of 
numbers to expect as input and output, but integer math 
just does not have the dynamic range to be used as a 
general purpose package. 

1 n order to avoid reinventing the wheel, I looked around 
in the public domain for FORTH floating point pack- 
ages, but 1 did not find very much! It is understandable 
that an author would prefer to sell a complete floating 
point math package, rather than giving it away, but that 
docs slow down the progress of FORTH as a generally 
accepted part of the family of languages. 

The best that I could find was a file called ZENFP.4TH 
on either the DDJ or the CLM forum on CompuServe. 
Unfortunately, my lousy record keeping prevents me 
from being more informative. This is a package written 
by Martin Tracy. I had to modify it a little bit to get it to 
work for me, but the changes were minimal. 

There is no question that this package works, but it 
produces results about equivalent to what I used to get 
with my wooden slide rule. You can't trust the answers 
beyond 3 significant figures, and it piints out a lot of 
trailing zeros, which give the impression of great accu- 
racy, but are really nothing but dangerous junk! 

I guess that 1 will just have to write my own package, if 
I want something useful. I found a very complete BCD 
package, written in assembly language for the 6800 in 
a government publication. I think that it could be 
adapted without too much difficulty, and I will give it a 
try. However, it will be a while before I can publish any 
results, since I have not yet started and there is a lot of 
testing to be done. 


August /Septembers 

68 Micro Journal 

You may well ask why I would bother to do a software 
math package when I already described an interface to 
a hardware (obsolete) calculator. 1 confess to altruism, 
modified by some self-interest. I no longer use the S-50 
machine, so that is not readily available, and it is too 
much trouble to even try to interface the board to the 
CoCo3! In effect, I want a math package which will 
work on any of my machines, including the (shudder) 
CP/M, so the only solution is high level FORTH. 1*11 let 
you know if and when I work it out. 

SRAM with its own lithium battery. The RAM draws so 
little current that the battery is expected to last for the 
full 5-7 year anticipated life of the instrument. This is 
the mass-storage system! 

The FORTH ismultitaskingandinterruptdriven. There 
are five to seven tasks to be performed during a meas- 
urement, and they have different priorities, so using 
interrupts was the obvious way to go. 

This was a very impressive demonstration! 

An Apology 

I hope that you will excuse the misspelled words and 
similar errors which cropped up more often, lately. I 
have been trying to use the Stylo package for FLEX on 
theCoCo, and it has been a real trial. My main problem 
has been that I sometimes type faster than the keyboard 
can respond, so that characters got left out. Also, I do 
transpose characters, even when I know better. When 
one adds these problems to just plain poor spelling, 
errors were bound to slip by even the most careful 
proofreading. My FLEX assembly language spelling 
checker does not work with the Stylo file, so I was 
reduced to visual inspection. As everyone should know 
by now, 100% visual inspection is an oxymoron! 

However, this problem should now disappear, since I 
have just got a new word processor specifically for the 
CoCo3. It is called "Simply Better'*, and believe me, it 
is! These files can easily be transferred to FLEX for my 
old spelling checker, or I may start using Spell *N Fix. 

Some Industry News 

I thought you would like to hear about a new application 
for FORTH and the 68701 (a version of the 6801). At 
the local FIG chapter meeting in January, Fred Carter 
described and demonstrated an instrument for measur- 
ing the light intensity at the end of a fiber optics cable. 
It is a hand-held device, about the size of a large 4- 
banger calculator. 

The device is mostly CMOS, except for the LCD 
display. The whole unit is driven by nicad batteries, 
except for the "ROM 1 ', which is actually a CMOS 


Brodie and other authors make so much to-do about the 
Data Stack that many beginners think that real FORTH 
programmers don't use variables. Actually, judicious 
use of variables can speed up the programming cycle 
and certainly make later maintenance and, horrors, 
changing the program a lot easier for yourself, or for 
someone else seeing it for the first time. 

There was a message thread on the GEnie FIG forum 
which made a very good argument for never using 
words which accessed the Data Stack any faither than 
the third item. In other words, ROT is ok, but stay away 
from PICK and ROLL . The idea is that it is too easy to 
get lost in the stack or to mess it up for other words if you 
have to go that deep. 

Variables don't take up very much memory norexecu- 
tion time on a 6809, so the question of when to use 
variables and when to use the Data Stack should be a 
question of which is easier to use and which is easier to 
understand in the particular situation. Any time you 
have to use a stack diagram in order to understand a 
definition, you have gone too deeply into the Data 
Stack. Remember, at some time or another, you will 
probably want to examine one of your previously writ- 
ten definitions, and you suie don't want to hassle with 
following umpteen items on the Data Stack while you 
are trying to follow the logic of your opus. 

I looked back through some of my old code, and I found 
an interesting pattern. When I first started with FORTH, 
I used a lot of variables, because I didn't really feel 
comfortable with the Data Stack. Later, I began to put 

68 Micro Journal 

August /Seplember89 


more and more on the stack and less and less into variables as I began to understand how the stack worked. But, 
now, I just don't want to bother with juggling the stack, so I use more variables. This month's code is a good 
example of that; a year ago, I would not have even considered using words like ADR in Screen #6. 1 would have 
avoided it just because I would have considered it poor FORTH practice! 

In defense of the Data Stack, I must point out that it affords secure local variable storage; whereas, any word 
defined as a VARIABLE (or VAR ) must be global (in "standard" FORTH) after it has b#cn defined. As a result, 
you can sometimes run into the problem common in BASIC, etc. of finding that a variable has unexpectedly 
changed. FORTH does have ways to force a VARIABLE to act only locally, but that is another topic which I will 
defer until another time. 

Now I know that good FORTH practice is what makes a program run well, while being easy to write and easy 
to understand! 


FORTH. LIST is a new version of the LIST command. 

It «lso contains definitions for: 




2 : .DATE-T C - > 


5 : CLS ( - ) 

6 12 EMIT 1 

10 -> 

\ RDL122688 

\ RDL011289 
\ RDL012589 











12 : 

< n - ) 

." Screen # 
) DUP . 

I 3 
I 64 


[ n 

( n 
CR ; 

.TRIO ( n - ) 
in) DUP 






3 ♦ SWAP DO 

\ RDL121988 

\ RDL011289 


OL < nl n2 - ) 

< nl ) ( n2 ) 1+ SWAP 
CR .* Screen •" I 
16 DO 

J BLOCK I 64 * 
IF I 3 .R 



\ RDL020189 


\ point to start of line 
\ chop trailing blanks 
\ if anything printable, 
\ print line! < text 
\ else skip line 

August /Septem ber*69 

68 Mcn> Journal 








FORTH. XFR transfers one or more blocks from one file to another. 

1 \ 

2 XFR+ transfers a single screen to an existing file. 

3 XFRS* transfers a series of screens to an existing file. 

4 XFR creates a new file and transfers a single screen to that 

5 file. 







4 ; 

XFR* ( scrl adr - 




( adr ) >PATH* 




16 DO 


( adr ) DUP 







\ RDL121988 

open path to existing file 
address of source block 

64 I 



\ return to normal output 

12 -> 

13 \ This command transfers a single screen. 

14 \ The command line has the form: 

15 \ scrl 0" file-name* XFR 












XFRS* ( first-scrt addr count - ) 


I 4 -R 




\ R0L121988 

\ save string address 

\ set loop limits 

\ display source! 

\ transfer the block 

\ The command line has the form: 

\ <first-scrl> 0" <name>" count XFRS* 


XFR 1 
{ adr 

< adr ) 

serf adr - 
) >PATH 



\ RDL012789 

open path to new file 
address of source block 



\ return to normal output 

9 \ This command transfers a single screen. 

10 \ The command line has the form: 

11 \ scrl 0" file-name" XFR 





66 Micro Journal 

AuQutt /September^ 


/T — WS 


j -it i h»>\t 

Ni-eding lo 

t- Know! A 

sa»». ., mrm 

68 MJ 

77ie Macintosh** Section 
Reserved as 

A place for your thoughts 
And ours 

Mac- Watch 

By James E. Law 

Reviewing HyperDA and MultiClip j 

A Review of HyperDA 

HyperCard has. without a doubt, represented 
a real step forward in making the power of the 
Macintosh available to application developeis who 
do not have years of programming experience. The 
problem has been that HypeiCard and its stacks 
are real RAM hogs. You can forget about running 
it on anything with less than a full MB of RAM. 
What may be worse, it cannot be ellectively iun 
under MultiFlnder without at least 2 MB of RAM. 
During the RAM shortage. I'm sure many would be 
users of HyperCard were turned off by their inabil- 
ity to access information in its stacks without 
quitting the currently active application. 

1 am continually amazed at* the ingenuity of 
Macintosh programmers, however, in finding ef- 
fective work arounds for previously confining soft- 
ware of hardware limitations. In this case. Bill 
Appleton did what Apple should have done to stait 
with. He developed a desk accessoiy which can be 
used while in any application to open and examine 
HyperCard stacks. It also allows you to copy text 
and graphic elements to the clipboard. 

HyperDA by Symmetiy Corporation is a 56K 
desk accessoiy and may be used on any Macintosh 
with at least 512Kof RAM, It is easily installed in 
the Apple Menu just like other desk accessories. 
This product comes with a number of small Hyper- 
Card stacks including a welt designed HyperDA 
Manual Stack. 

Getting Started 

When you open HyperDA. it places its own 
menu on the standard menu bar. You may then 
select OPEN STACK 
to see a list of Hyper- 
Card stacks. Select 
any of them and the 
stack is quickly 
opened. This menu 
bar also contains 
Close Stack, Page 
Setup. Print Card. 
Find, Quit HyperDA. 
selections for ma- 
neuvering through 
stacks (e.g.. NEXT. 

Window Options 

In HyperCard, 
the window usually 
takes over the entire 
screen. If HyperDA 
took the same ap- 
proach, it would be 
difficult to easily 
switch between the 

open HyperCard Stack and other open documents 
or to view both simultaneously. HyperDA ad- 
dresses this issue by allowing you to choose the 
foimat of the HyperDA window. You may elect to 


Open Stack... 
Close Stack 

Page Setup- 
Print Card... 




Quit HyperDR 




The HyperDA Menu 


August /September '89 

68 Micro Journal 

view it as tt would appear under the control of the 
HyperCard application or as a scroll able and re 
sizable window. The latter option works much 
better when you have other applications open con- 
currently with HyperDA. 

What HyperDA Does 

HyperDA allows you to do the sorts of things 
that you could do in HyperCards "browse" mode. 
You can view cards, progressing through the stack 
by clicking the appropriate buttons. Most (but not 
all) buttons may be activated by HyperDA. An 
extremely valuable feature is the ability to select 
and copy text and graphics from HyperCard 
stacks. When the cursor is moved over a text field. 
it turns into the typical T bar text tool and can be 
used to select and copy text. By holding down the 
OPTION key and dragging, graphic elements may 
be selected and copied. 


HyperDA is accompanied by a well designed 
and helpful manual. The HyperDA Manual stack 
contains essentially the same information as the 
hard copy manual and works very well. In prac- 
tice, this product is so straight forward you proba- 
bly will not need to refer to either manual. 

Should You Buy it? 

HyperDA does what It is suppose to do in a 
simple yet elegant manner. If you use HyperCard, 
you need HyperDA. This is especially true if you 
have less than two MB of RAM. 

The original clipboard feature of the Macin- 
tosh presented new communication possibilities 
not readily available in other computers. The clip- 
board allowed transfer of text and graphics be- 
tween applications and documents at will. The 
only problem was that the clipboard contained 
only one item. If you cut or copied an item into the 
clipboard, this Hem replaced what was already 
there. A number of times I have saved an item to 
the clipboard for later use and Inadvertantly used 
the clipboard for another operation. The first item 
was then lost forever. So while the clipboard was 
a remarkable step forward for its day. its utility is 
limited by its capacity of only one image. 

A Review of MultiClip 

A Cllpboard/scrapbook replacement that 
allows multiple clipboards. 

Introducing MultiClip 

It would be nice if Apple were more proactive In 
identlfing and fixing limitations In its system soft- 
ware, but that doesn't seem to be the case. (Or will 
System 7.0 prove me wrong?) It's a good thing that 
the commercial spirit, or love of a good challenge, 
drives other talented programmers to provide en- 
hanced system software. So it is with the clip- 
board's limitation. MultiClip by Olduvai Corpora- 
tion is presented as a significant enhancement to 
the Apple clipboard. Let's see if it delivers. 

MultiClip is an 1NIT and so is activated by plac- 
ing it in your system folder and restarting your 
Macintosh. It requires at least 5 12Ke hardware and 
system software 6.0.2 or later. 

Using MultiClip 

MultiClip can be used just like the old clipboard 
to facilitate cutting, copying, and pasting. The big 
difference is that you can cut or copy an almost 
unlimited number of items to the clipboard and all 
are preserved. When you want to paste from the 
Clipboard, you may paste sequentially In the same 
order that you placed the items into the clipboard. 
Alternately, you may elect to have MultiClip paste 
in the reseive order that the items were cut or 
copied. Obviously, there would be no practical 
value in retaining hundreds of past clipboard im- 
ages. Usually you need to use only the last few. If 
you did maintain all those Images, you would have 
no way to find the one you want. Consequently, 
MultiClip allows you to set a limit on the number of 
Images to be maintained. When this number is 
reached, the oldest image is deleted. 

MultiClip uses different key commands from 
the old clipboard (e.g.. Command ♦ Option +"X" to 
cut). This allows you to continue to use both clip- 
boards if you wish (although I don't see an value in 
keeping the old one if you have MultiClip. 

MultiClip has a sizable collection of *hot keys" 
that is. keyboard commands for speeding up the 
process of using the clipboard. The keys assigned 
to each function can be changed. 

By pressing designated "hot keys," a window is 
displayed showing minature images of each item 
saved in MultiClip. This window Is well designed to 

66 More Jourrwl 

August /September 89 

give you good control of almost all activities involv- 
ing the clipboards. By processing certain keys and 
dragging you may change the order of images in 
the MultiClip window and thus the order in which 
they are pasted back into your document. You 
may also duplicate and delete MultiClip images 
while viewing the MultiClip window. By double 
clicking an image, you can see it full-sized in a 
scrollable window. 

Edit ClipFrames 

Saue Rs... 


Input From 

Output To 
Rppend To 

Scrapbook File 
MultiClip File 




Portion ofMulti Clip Menu Showing 
Inport/Export Capability 

Working with MultiClip Images 

You can use a selection rectangle to select por- 
tions of graphic images in the MultiClip window 
and similarly can use a text tool to select text. 
Selected items can be copied or used to create a 
separate MultiClip frame. MultiClip doesn't stop 
there. When you view MultiClip frames containing 
text, you may edit that text (e,g,, paste new text 
into the frame, cut text, and type in changes). 
When you compare this level of versatility and 
power with the old clipboard, you will see that 
MultiClip is light-years ahead. 

MultiClip has powerful importing and exporting 
capability. By selecting "Input From" in the file 
menu, you can obtain and transfer into MultiClip 
images from scrapbook liles, documents, or other 
MultiClip files. You may output to a scrap book file 
or to a document. When you output a graphic 
image to a document, you may elect to output it as 
a Paint or PICT image, either of which can then be 
opened and modified by the proper graphics appli- 
cation software. 

Out With the Old; In With the New 

During this review. I put MultiClip through its 
paces by using most of its features including a 
vaiiety of imports and expoits of files. Never once 
did it disappoint me. I like this program and 
suggest that you throw away the antiquated Apple 
clipboard DA and install a real work horse, that is, 

By James E. Law 
1806 Rock Bluff Rd. 
HixsonTN 37343 


68 MICRO^ 

August (September^ 

68 Mem Journal 


Software Timing Loops 


This article explains a technique of using the assembler's symbol manipulation power to control software tuning loops by letting it calculate ihe 
instruction cycles used per loop and the required loop count constant. Assembler modifications to automatically support liming loop constant 
calculations are also presented. 

About the author 

Peter S. Gilmour is a Senior Systems Analyst with over 15 years experience. He is currently employed by ihe Motorola Microprocessor Group in 
Austin Texas where he works on the Motorola HDS-300 line of real lime emulators for the Development Systems Group. He has a B.S. from Case 
Institute of Technology and aM.S. from Arizona State University. His interests include tennis, golf, and personal computing. He has several published 
articles, including a two pan series titled Designer's Guide to fine-tuning uPAiC code in the May 25/ June 8, 1989 issues of EDN, and Automated 
Software Testing in the April 6, 1989 issue of Machine Design. He can be reached at Motorola at (512) 891-2850. 

Software timing loops have long been utilized to provide timing functions when no real time clock is available. The main use for timing loops is 
to control hardware functions when a fixed delay time is required between access big two hardware functions to allow time for ihe haidware to respond, 
i,e. the hardware is "slow "compared to the speed of the processor. As an example, consider the Western Digital WDZ793 floppy disk control ler(FDC) 
chip. When a command is written to the chip's Command Register, a delay of at least 12 usee for double density, 1 MHz operation must be observed 
before the BUS Y bit in thechip 1 s Status Register becomes valid, i.e. the controllerneeds some time for "internal sync cycles" before it can set the BU SY 
bit. Another typical use for timing loops is a "timeout" function, i.e. a maximum amount of time is to be spent waiting for a certain condition before 
giving up. An example of a "timeout" function would be waiting a maximum of N msec for a character to arrive on a serial port before aborting. A 
non hardware use can be as simple as "wasting" some computer time so humans can read a display message before processing continues. The uses 
are endless, but managing, let alone taming these liming loops, has always seemed just beyond reach. 

Previous methods to manage software timing loops have included empirical "trial-and-error" determination and hand calculations based upon clock 
frequency and instruction cycles used in the loop. The "trial -and -error" method usually involves additional equipment, such as oscilloscopes or 
frequency counters, to arrive at the right loop liming constant. It may even require special code segments to test the timing. Hand calculations are prone 
to errors and must be xcpetinl for each instruction change in ihe loop. Unfortunately, both methods are not very well documented unless ihe program- 
mer includes them as comments. There is no easy way to verify or modify a liming loop after iihas been coded with these methods. Not waiting enough 
lime causes ujuvxe&sary errors, including erratic operation or mysterious "crashes", while waiting loo long causes a degradation in overall system 

A much simpler technique is to use ihe power of the assembler's symbol processing ("equate" and "set" statements such as found in Motorola's 
Macro Assemblers) to calculate timing constants at assembly time. By entering all parameters as symbols, the assembler can use its arithmetic capability 
to calculate the required timing constants. The two basic assembler symbol manipulation pseudo-instructions used to implement this technique are 
defined as follows: 

EQU * assign the expression value to a symbol (cannot be redefined, \jt. it is "absolute**) 

SET • assign the expression value lo a symbol (can be redefined) 

When all parameter!; are defined as symbols, verification is reduced to checking the parameters versus the symbols and verifying Ihe equations 
defining the liming constants. The use of symbols to enter the hardware timing requirements as read from specification sheets (in the stated time units) 
assures lhat the actual delay time will maich the specification. Modifications are simplified by addition and/or subtraction of the required instructions 
and corresponding cycle count equations. Reassembly will then automatically recalculate the correct timing constant. This EQU/SET technique can 
be used in all designs when the CPU has a fixed execution cycle time, such as the Motorola M6800 family. M6805 family, MC6809, MC68HCM, 
MC68000, MC68008. and MC68010 (except Loop Mode Operation). CPUs with pipeline and/or instruction caching features, such as the Motorola 
MC68020 and MC68030, will not work. 

The basic method utilized for all software timing loops is to execute enough instruction cycles at the known processor clock frequency to produce 
the required delay time. This translates to the simple formula of 

60 Micro Journal August /Septembers 51 

T=X/F (Equation I) 


T * delay lime 

X = total number of instruction cycles executed 

F s clock frequency 

Equation I can be broken down further as follows. 

X * N • U (Equation 2) 


N = number of times thru the timing loop (timing constant) 
U = number of instruction cycles per loop 

Subsiiiutng Equation 2 into Equation I gives; 

T=(N*U)/F (Equation 3) 

Solving Equation 3 for N, the timing constant required for the delay loop yields: 

T * F = N * U 

N = Cr'F)/U (Equation 4) 

Because instiuction cycles come in integer quantities, a "guard band" value must be entered to ensure the delay is 'at least" the required amount 
of time. This avoids the truncation problem associated with integer arithmetic because fractional remainders are discarded. Tikis is accomplished by 
modifying Equal on 4 to add "U~l" to the numeraict as follows so airy fractional value will cause incrementing to the next integer value: 

N = ((T • F) + (U - 1 )) / U (Equation 5) 

For a simplified example of the truncal) on problem, consider the following example. 

Example 1. 

Given: C T * F) = 8 cycles U = 3 cycles/loop 

Equal on 4 would yield: 

N = 8/3-2 

Thus only (N * U) = 6 cycles would be executed, not 8 as required. 

Equation 5 would yield: 

N = (8+(3-l))/3^3 

Thus (N • U) = 9 cycles would be executed, which is 1 more than the 8 required. 

As can be seen, N = 3 is the minimum required value. 

Since (he clock frequency (F) and the required delay time CO are lanown, only (he number of instruction cycles executed per loop (U) is missing. 
By entering the number of cycles executed for each loop instruction immediately after each loop instruction, the assembler will "iota! up** the cycles 
executed per loop. Finally, a statement modeled on Equation 5 is constructed to calculate the required timing constanL 

The only restrictions on using the assembler's symbol table processing are (I ) integer arithmetic, (2) arithmetic overflow, and (3) round off errors. 
Thus the clock frequency can not be entered as 1500000 H2, as it would certainly cause arithmetic overflow. Error conditions can be introduced by 
operand order, i.e. (A*B)/C may cause overflow, while (A/C)*B may cause a round of! error, but (B/C)* A will yield the correct answer. To avoidlhese 
errors* great care and consideration for the order and value range of variables must be exercised when constructing the assembler timing equations. 
Also, be conscious of the symbol value storage siae of the assembler (usually 16 or 32 bits), as this affects overflow during calculations 

The EQU/SEr technique can best be illustrated by examination of Listing La, This listing shows a Motorola MC68HC1 1 processor timing loop 
that waits up to I msec for a bit in a hardware status register (memory location) Co become set The code exits when either thebit becomes set, or lime 
has expired. 

52 August /September &d 68 tficro Journal 

Line numbers have been added it ihe beginning of each line for identification purrxases of the following discussion, listing 1 .a is an example of 
a software timing loop without using my technique. It is difficult to unctostand how long the timeout constant in line 40 causes the code to wait. Even 
if a comment was added seating the wait time, it isn't cenain the program really waits that long, i.e. it would be difficult to veiify the tuning constant 
as correct. 

Listing 1 .a 





; h/w status reg.: Bit7- 1 when 












; Branch if status - ready! 



; Decrement theloop count. 




; Branch if not timed out yet! 




; He re 

for timeout? 





; Here when ready! 

Listing l.b shows the same program but with lines added to use the EQU/SET technique. Line 1 defines the MPU clock frequency that this code 
will execute at, and line 20 defines the number of usee to wait for the status bit before timing out Note that these values are entered in units of MHz, 
and usee in order to simplify the equation calculation in line 92. Line 50 resets ihe instruction cycle count, US, to zero for the timing loop which starts 
in line 60, For each instruction in ihe loop (lines 60, 70, 80. and 90), a line is inserted immediately afterwards (Lines 61,71, 81,91) which adds the 
cycle count of the previous line to the previous cycle total, i.e. a running "subtotal**. The instruction cycle count for each instruction is found in the 
M68HCI I Reference Manual, Appendix A, Instruction Set Details, For example, the manual shows that the TST instruction on line 60 uses 6 cycles 
because the addressing mode is "EXTENDED". The other cycle counts are obtained in a similar manner, based on opcode and addressing mode. Line 
92 calculates the required delay count, DELCNT, using Equation 5 above. An equate (EQU) is used to define DELCNT because it is a fixed constant 
needed for this particular loop (used in assembler pass 2 to complete ihe instruction in line 40 which loads the timeout count). Other loops will have 
their own constants defined In this example, the calculated cycle count US, isO+6+3+2+3 - 14 ($0E) and delay count. DELCNT. is (1000^(14-1))/ 
14* 72 ($48). 

Listing l.b 





MPU clock frequency in MH2 




V of usee for status bit to 

be ready 





h/w status reg.8it7- 1 when 








Clear cycle count. 








US + 6 




Branch if status - ready! 








Decrement the loop count. 





Nationwide Specialists In The 

Recruitment And Placement of 

Software Engineers 

Compter Design, Kernel Mocfcftcaton. 

OS Intern* Voice and Data Communica- 
tion, Network Desgin, Windows. X 
Windows. NeWs, Desk Top Publishing, 
CAD/CAE/CAWCASE, Language Design. 
OOP, AJ Graphics, Hester Technologies. 
Laser/Dtek/V)deQ Systems Database 
Design, Porting .Systems Archl lecture 
"Start Up", Venture Capital Emerging 
Technology Companies 

Naytand Associates 

Route 2, Box 352 

Nebo, NC 28761 


High Performance 

SCSI Subsystems for 
OS-9 Users 

• Hard Disks (up to 700MB) 

• Erasable Optical (650MB) 

• Exabyte-8mm (2300MB) 
•1/2"- 1/4" Tape 

• SCSI Host Adapters 

Introl Corporation 

2675 Potton Rood St. Poul, MN 55113 
(600) 626-4261 (612) 631 -7600 

68 Mtero Journal 

August /September 69 




LOOP ; Branch if not tim 




US + 3 




( <FREQ*RDY7IME) ♦ <US-1) ) /US 



EXPIRED ; Here for time out 




■ ; Here when ready! 

IT the rced arose to insert an instruction in the loop, it would be done by inserting ihe lines below into their respective places. 

076 US 


Delay status accesses. 

US + 2 

Reassembly would change the calculated cycle count. U $, to 0*6+3+2+2+3 = 16 ($1 0) and delay count. DELCNT. to ( 1 000+< 16-1 ))/l 6 = 63 ($3F). 
Deleting an instruction is even easier; just remove the instruction line and its associated cycle calculation line, and reassemble. 

Verif icakon of the timing loop for Listing I . b would involve checking each cycle count sub total line for the correct instruction cycles and checking 
thedelay count calculation line for correctness. 

Listing 2 shows a more advanced version of this technique to find ihe elapsed time for a quick RAM memory check from a bootstrap ROM using 
a Motorola MC68008 processor. The quick memory check is to be done while the user is reading the system signon/copyright message that has just 
been displayed on the user's terminal. This accomplishes two things, namely testing the RAM and delaying long enough so the signon message can 
be read. Thus one needs to know the amount of time consumed by the quick memory test. The system is supplied with either 512K or 896K bytes 
of RAM. Ihe technique here is more complicated than that shown in Listing Lb, because there are different numbers of wait cycles involved for read 
and write accesses to the different system resources, namely RAM. ROM, floppy disk controller (FDC), and Motorola MC68230 Parallel Interface/ 
Timer (PI/T) chips. Ihe code in Listing 2 executes in ROM (read) and accesses RAM (read and writes) in order to lest it 

Lines 1 50-250 define the wail cycle counts for the v at ious system resources dui ing read and wi ite accesses. Line 2 80def ines the clock frequency 
this code will execute at. Line 310 defines the test pattern value to be used. Lines 350-400 set up the registers outside the loop. Line 401 resets the 
instruction cycle count. US. frior to entering the loop atline 420. The loop instruction lines (430. 450. 470,490. 520. 540. 560. 580. 600. 620) are 
immediately followed by Lines which total up the insnuction cycles (431. 451. 471. 491. 521. 541, 561. 581. 601. 621). The instruction cycle count 
for each instruction is found in the M68000 8-/16-/32-Bit Microprocessors User's Manual. For example, the manual shows in Section 9, Table 9-4, 
that the MOVE.L instruction on line 430 uses 24 cycles for instruction fetch. 2 cycles for operand reads (from ROM) and 4 cycles for operand writes 
(to RAM). Ihe read and write cycle times must then be multiplied by the numberof waitcycles per read or write for the proper resource being accessed 
(ROM or RAM). The other cycle counts are obtained in a similar manner, based on opcode and addressing mode. Lines 631 and 632 calculate the 
number of usee to check 5 12K and 896K bytes of RAM respectively. In this example, the calculated values are $00390000 (3,735.552) for 5 12K and 
$00630000 (6,537, 216) for 896K. Simple math converts these to 3.7 and 6.5 seconds, respectively. Executing the code verifies the calculations as 

CAREEN 68K brings Ihe power of OS 9/ 
68000 in your tBM-PC 

Thehigh performance Add-In Board CAREEN 
68K changes ihe character ol your PC from a 
simple documentation tool to a powerful real- 
time software development system. 

H you want more informations, 
tore is your contact address: 

D-7987 Welngarten 
West Germany 

Telefax: (0751) 53199 
^Telephone: (0751)52327 ^ 


Disco?er which functions within your 
C or Asseibly prograas take the aost 
tile to run. An imaluable 
development tool for anyone worried 
about proem speed. 

For information on this product 
and our other OS-9 software 
development packages: IMP (the 
Intelligent Rake Prograi), STIHQLOS 
(Artificial Intelligence Language) . 
cade library) contact: - 


D Dm no re, Doune, 
Q Perthshire, 
FS 16 641, SCOTLAND. 

Phone (444) 78685-261. 


AOtCON ta a oonvutVvj and 
■ V » «**H ami pnMJm a 

ranga gl ****** fcndu*^ 
pnodkttt i 

far oar*. Wa 

data m ft* Mow*? MOTORDIA 


■ 6805, 66HC11. 68000/20 

■ Single Board Carr*7utara 

■ VMEbus systems 


■ Assembly Language 




1123 N. 



August /Septembers^ 

68 Micro Journal 

Listing 2 

010 * NOTES: 

020 * 1- System utilizes an MC68008 at 8 MHz clock, rate with the following wait 

030 * cycles; 

040 * Wait Cycles/ Wait Cycles/ 

050 'Resource Read Access Write Access 

060 »»»■■■■ *. .._----- ««*«*!_«•« 

070 *RAM 1 1 

080 *ROM 2 2 

090 *FDC 2 3 

100 *68230 3 4 

110 * 

120 * Since this program runs in the ROM, the wait constants are defined as... 

130 * are defined as... 

140 * 

RAM read access 
RAM write access 

ROM read access 
ROM write access 

FDC read access 
FDC write access 

68230 read access 
68230 write access 

290 * NOTE d 6. 000 MHz .01% crystal divided by 2 is used to obtain the 8 MHz 

300 * clock frequency! 

310 PATTERN EQU $55555555 ; test pattern- every other bit ON 

320 * 

330 * Al- calculated end of RAM address (512K or 896K) 

340 • 

350 SUBA.L A0,A0 ; set A0-L* RAM test pointer 

360 * ; <start at 90000) 

370 MOVE.L tPATTERN.Dl ; set DLL- test pattern 

380 MOVE.L Dl,D3 ; (takes fewer bytes than 

390 * ; another MOVE.L I instr!) 

400 NOT.L D3 ; set D3.L- inverse test pattern 

401 US SET 


430 MOVE.L 01, <A0) ; store regular pattern 

431 US SET 




I wait cycles 





1 wait cycles 







; wait cycles 





; wait cycles 







; wait cycles 





; wait cycles 





WC R230 EQU 


; wait cycles 





; wait cycles 









; MPU clock fj 









P.O. BOX 2716 
1 WARMINSTER PA 18974 (215)457 6805 

r ■* 

Fulfilling the needs 
of the nation's high tech 
community for over a 

Leaders In Hardware 

and Software consulting for 

real-time military and Industrial 


AI MJcnxyacmt, Inc. 
One Ntpecvilk PUza 
Ntparvilk, IL 60540 

Tbmofmw's Technology Today! 


Use Your Computer To 
Measure Radiation. 
Write Or Call For 
Our Sensor Catalog. 

For moro information pteat* C9tt Of writ*: 

LaGrange Instruments, Inc. 

Kuchlar Drive 

LaGrangtvilla, NY 12540 

(914) 223-3336 

68 Moro Journal 

August /Septamber89 




MOVE.L (A0),D2; read back what was written 









CMP.L D1,D2 


BNE.B RAMQER2 ; check regular pattern 

US SET U$*12*2*WC RROK+0 

MOVE.L D3, (AO) ; store inverse pattern 


MOVE.L (A0)*,D2 read back what was written 

SET U$*24*2*WC_RROM*4 # WC_R 

CMP.L D3.D2 

SET U$*10*2*NC_RROM*0 

BNE.B RAMQERl ; check inverse pattern 

SET U$*12*2*WC_RROM*0 

CMPA.L A0,A1 ; check for end of RAM 

SET U$*10*2*HC_RROK*0 

BNE.B RAMCHKLfc continue until end of RAM 

SET US*18*4»WC_RROM*0 ; I cycles for RAM test loop 


($80000/4) *U$/FREQ 

I usee to check 512K bytes 
I usee to check B96K bytes 


An imjirovcmciu over the EQU7SET method would be id modify the a&enuMer to add the instruction cycle timing information and some featuies 
to utilize it, to the assembler will do all the work. The new features required are to add three reserved symbols (F$, C$, U$) and one pseudo<7pcode 
(CALCDEL), as defined below. Reserved symbols are symbols exclusively assigned to the assembler for its use. 

FS absolute symbol whose value is the execution fvuceisor clock speed in MHz (real number). 

C$ (^definable symbol whose value is trie execution cycle count of the Usi instruction assembled. 


OS9 Proforionai™ ind: 
C, 6*ak, Emaca, Kermis 
S record download, OS9 to TOS transfer, 
Sculptor 7 * Dynacalc™, Stylograph*" 

g Seial Port board for the MEGA ST, 
12 bit Analogue I/O interface. 
16 bit Parallel Interface. 
EPKOM Programmer. 


T.J.P. Qerfronlcs Ltd. 
3 West Street, 
North Yorkshire, 
YOll 2QL 

Tel U.K. 725-378837 
< £AX U.K. 723^500435 









8332 FB0GT ST. 

J <. 



A HAM* YOlfU.1 

ROUTE 12 BOX 322 



First to offer OS-9 
68000 on the STD Bus. 
Pull line of memory , 
serial, parallel, 
analog, digital, and 
video I/O. Pull 
systems tool 

August /September^ 

68 Mont Journal 

US redcfinablc symbol wJiose value is the summation of the execution cycle counts of the previously assembled instmctions, i.e. for each 

US = US + CS. 

CALCDEL assigns the value of (he lime delay equation (Equation 5) to the symbol in the label field. 


<label> CALCDEL <delay_time>[,<time_units>) where <label> is the symbol name to receive the value of the time delay 

equation. <delay_time> is the minimum required delay time (T). <time_units> is the optional time units; USEC (default), MSEC, SEC, SECOND, 

An assembler option could also be added which would include the instruction cycle count for each instruction (i.e. "CS**) as part of the assembly 
listing. Using an assembler with these features, the program shown in Listing l.a would be modified to that shown in Listing 3. Note how much more 
readable it is then the EQU/SEr method shown in Listing l.b. Real number capability allows for using the full range of processor clock speeds (Hz, 
KHz, MHz) and time delays (usee, msec. sec). To avoid anmca lion/overflow problems, CALCDEL should insert the calculated constant back into the 
time delay equation to ensure that the required delay is met. If it is not, increment the constant and repeat until ihe required delay is achieved. 

Listing 3 













1.000 ; 


SFEC8 ; 



; Branch 

MPU clock frequency in 
I of usee for status bit 
h/w status reg.: Bit7- 1 

Clear cycle count. 

to be ready 
when ready 

if status - ready! 
; Decrement the loop count. 
LOOP ; Branch i( not timed out yet ! 
CALCDELRDYTIME, USEC ; Calculate delay constant 
EXPIRED; Here for tiineout! 
EOU * ; Here when ready! 

A furthd refinement would be to expand the symbol definition pseudo -opcodes (EQU. SET) to include admits" value, such as time (USEC. MSEC, 
SEQor frequency (HZ. KHZ, MHZ). This would allow the CALCDEL pseudo-opcode to automatically compensate for different "units' and it makes 
a much more understandable listing. For example. lines 10. 20. and 92 of Listing 3 would become as follows; 

010 F$ £QO 1.000, MHZ; MPU clock frequency 

020 RDYTIMEEQO 1000, USEC; Time for status bit to be ready 

092 DELOJT CALCDELRDYTIME; Calculate delay constant 







• Embedded Applications 

• Single Board Computers 

• VME and Multibus 

5415 Oberlin Drive 
San Diego, CA 92121 
FAX: (619) 457-1168 


The Raal-Tfaw Control System 
picksge RCS-7 provides the basic 
functions of a SCADA < Supervisory 
Control and Data Acquisition) 
system, RCS-7 utilizes Multi- 
tasking and distributed systems 
and supports aost RTUs and 
programmable controllers. RCS-7 
is field-proven In the OIL/GAS, 
Industries, The RCS-7 system and 
expert consulting services are 
available. Please contact: 


5730 MRBV Oft., STE. 6SO 
TEL: (713)524-3100 
Fax: (713)524-045 


OS-9/68020, 68000. 6809 

C. Forth, Asm. Sculptor 

Embedded Systems 

Device Drivers 


Richard Hogg 


Ace Programmer 

(717) 343 1317 
430 S. Edwards Ct 
Scranton. PA 18504 




68 Mcro Journal 

August /September *89 


Since ihc puiposc of these delays is to ensure a minimum delay time is achieved, enabling interrupts in a system would only add the interrupt service 
lime to the delay. Thus the technique will still funct on with interrupts. 

In conclusion, it is possible to not only understand, but to control and maintain software liming loops by using the power of the assembler tocalculalc 
the required constants. By entering all liming variables as symbols, they become self-documenting. Adding and/or subtracting instructions is much 
easier, because reassembling will recalculate ihc required liming constants. Code verification is also much easier, because the task is broken inio the 
smaller pieces of verifying symbol definitions, instruction cycle counts, and simple equation calculations. 


MC68HCI1 Reference Manual, M68HC11RM/AD, Prentice-Hall, Englc wood Cliffs. N.J. 07632 

M68000 8-/16-/32-BU Microprocessors User's Manual. M68000UM/AD REV 5. sixth edition, Prentice-Hall. Englcwood Cliffs, N.J. 07632 

Western Digital 1983 Components Handbook. Western Digital Corp.. 2445 McCabe Way. Irvine, CA 92714 





As Submitted - No Guarantees 




Surplus Unused Motorola VME Modules & Electronic 
Solutions Enclosures for Sale at Discount 

MVME133-CPU Modulc-68020. 1MB DRAM. 68881 FPP. 3 serial 
Ports, EPROM Sockets. VMEbus lntcrfacc^S675 
MVME225-I-1MB DRAM Module, A32/D32 VMEbus Interface 

MVME320A-Winchcsicr / Rlopy Controller $490 
MVME332-8 Channel intelligent Serial Communications Module 

Scries 7 -Electronic Solutions 7 Slot Desktop Enclosure. P1/P2 $695 
Backplane. 325 W PS, Space for Winchestcr/Floppy/Tape 
Respond to: John Gannon. RPG, P.O. Box C12399, Sic 162, 
Scousdalc, Arizona 85267 Phone (602) 951 3373 


CDS- 1. 20 Meg Hard Disk w/confroUcr $100 

S+ Memory Cards. CPU Cards. Hard Disks w/Conirollcr Cards. I/O 

Cards, Cabinets. Power Supplies. 

S/09 CPU Cards. Memory, I/O Cards. Controller Cards, Cabincis. 

Power Supplies 

3-Dual 8" drive enclosure with power supply. New in box, SI 25 each, 

5-Sicmcns 8" Disk Drive. $100 each. 

Tom (615) 842-4600 M-F 9AM to SPM EST 

PT-68 Assembled System; Monilor, Keyboard. 80 Track Floopy 
Drive, 20 Meg Hard Drive with SK*DOS & Basic $10i0. Doug 


* OmegaSoft Pascal is designed for real time control 
systems using the 6809, 68000, 68010, 68020, 68030, 
68881* and 68882 processors. The object code can be run 
on an operating system (support for host operating system 
comes standard) or without an operating system. No 
royalties are charged on the code you generate or the 
runtime library. All packages include the "Pascal Shell", 
compiler, assembler, linker, and screen editor. 

* P20K will generate code for the 68000 series, and runs 
on a host using the OS- 9/68000 (tm Micropore) or PDOS 
(tm Eyring Research) operating systems. A high levet 
debugger is included for debugging on the host 
development system. A target debugger is available as an 
option. Prices are from $585 to $980 dependmg on 

* PXK9 will generate code for a 6809, and runs on a host 
using the OS- 9/68000 operating system, A high levet 
debugger is included for debugging programs on a 6809 
target system using a serial link to the host. A 
Multitasking Kernel is included with the package, and is 
supported by the debugger. Price is $800. 


P.O. BOX 70 


TEL: 802-728-4062 

FAX: 802-728-4126 


August /September'89 



SI06 . $KLK)SM5D05,UNiX r Xl'HtX iOHJKCT OM.Y) 
Accept KAR C4*>piate,gocrtta(JtX10 Ai*embtet code 
idC(kM»«S010cmASKS«bkr.^t>nnetp(v««kd to cmy ht modified 



Specify: 1*0*. 6502, 6*01/1 1. 6804. 6*05. 6S09. 28. 280. 80*8. 8051. 8085, 680:0. 32000 
Mulais ckm axsanHo* In C, with InadMkad uailltk* Sum for additional 550 tath,. S 100 for 
3. $300 for 41 


Mcno-dnvcn wun taming mode. fUe nntfc/. MOOfcXO, 7(0M XOFI 2 . <*c- 


iMcacttvcly generate loitnre ondn* w*di bbcU, tnetudes urf. ttav> tditdig 
Spe^ily 6*»J .2.XS JAfcWC vmmn cv fiUlflWWU.5 tclittfl 
CXXX* DOS iv^taWo m 61(00,1 .2.3.U 9&W2 m«on (pot Z80v»kK).S> only 
4M10 vcriton $]D*^LKX.OS».UNIf t.KX,MSOOS,UNlX.SKDOS.XKNlX 


Specify far 6800/L <H#KW, 6302. 6809 OS9 wdy.ZTO FLEX only 


6502 to 6909 SH-FLF.X S0SOS? SSO^t'NtfLEX 

UIQOtt to 4009 & €809 to pot-imd. SS0-FLFX V1.0S9 Onty tOO-VSIFlXX 


available; for flex, uniflex, and msdos 

Display Oatcrzia ( Documentor 
Mil I int U« VWcm 

IiwiUlm-y with MKP 
TaZrfft R*b> Sfradsnrci 

SSO w/jouiu. 515 without 

SII«l*.'*iurLf. JSOwiQvm 

ildnw^ourw, SSOwiitoul 

SlOOwftwns, % without 


twu:x si*vmrLi'xrmitos 

E-il dill Whwi. «H dins Lt> . maintain rauUcr catalog, do duk tfU r resequence rant nt all 
BASIC froimrtl. *nJ BASIC (w«r»n». «t fwdO vtnUn iDtkafe rai and rrw*faemer only 




We will <iiflr*niac my Qi ihc program dtaenfed in Urn advcrtnaacnJ or in our ftrochtat for 
«perfc«lbfld cuaoma u* <* *> cover new liuuiiv fee charge fot iutn cuuomiuiDon defend* 
upoo a* myteaotiity gCOc (npdrfcaiflBs. 


We will OBH new (fupwtf or modify e*i*jp| piugjmu on i connct oaaia. a service wc oavc 
provido) for ovef twenty yean; inc oompucn on wtucik *« Jtavt pcrfereed oorfrart prpmAuurn) 
bclude nood (woufca» a>odci»<rf manB£«n«. avlubn^ IBM, Rirougfe*, Unt»ar. Ikneym^. most 
pular *ookl» o4 (nJotconjpwiMt. knclndut^ DttC r IBM. DO. HP. A TAT, and moit popular 
braoos of nienxvopuierx including 6«00/l. 6809, ZW, 6502. 6iW»0. uawf mo* •nproj»u W 
UcBvate* and oporalini xyfltini. on synurvt rnttB^f * am from I vje ukssMnjounh^iisBi hi 
sut|)o oo««rd cosa7t0lav Ac charge rar amine* profTaffiavm U usually Vt the boui or toy 0k cui 


Wc olta » wide r. 

peof bunocnaod lecnaical 
on ray look rcuued lo 
d', and eAjuuta. 

f kcrricex. ha;Sudi0{ ton i nan, advkc. 
the tharfe for consulung » oonaalty 

Computer Systems Consultants Inc. 


Con yen, Govpa 30207 
(404) «83-*SHJ - (404)443]?]? 

™n. t , T , o ,,■,,. tffi, 4nk in J^l ^| 
ki V LSA Hd MhlTFJi CARD *rap*l Aid t.A Mht i*t (J to If A> arf ** 

rdiidtoii OiM M.Lh7*t<t COCD liNfiUvms M., r,„,*i -iklN i\ 14WI 

Transfer Utilities 

For 68020 and CoCo* OS-9 Systems 




These Utilities come with a rich set of options 

allowing the transfer of text type files from/to 

FLEX & MS-DOS disks. 

*CoCo systems require the D.P. Johnson 

SDISK utilities and OS-9 and two drives of 

which one must be a "host" floppy. 

CoCo Version: $69-95 68020 Version $99.95 

S.I-:. Media 

PO Box 849 

5900 Cassandra Smith Rd. 
Hixson,TN 37343 
(615) 842-7990 

FAX (615) 842-4600 




& | 

OS-9™ : 

NOW! - If you have either the Atari 520 or I 
1040 - you can take advantage of the "bor- * 
gain of a lifetime" OS-9 68K and BASIC all • 
for the low, low price of: • 


Call or Write 

SE AAedia 

5900 Cassandra Smith Rd. 

Hixson. TTsI 37343 

cbl5 842-4d>01 

FAX Icb15)842-7<?<?0 

68 Micro Journal 

August /September'89 



PAT WITH 6 C Source $229.00 
JUST WITH 4 C Source $79.95 

OS-9 68K - 68008 - 68000 - 68010 - 68020 - OS-9 68K 


with all the best of PIE. For those who swore by and loved PIE, this is for YOU! All PIE features 
& much more! Too many features to list. And if you don't like ours, change or add your own. C 
source included. Easily configures to your CRT terminal, with special configuration section. No 




Special $249.00 

JUST from S. E. MEDIA — Text formatter written by Ron Anderson; for dot matrix printers, 
provides many unique features. Output formatted to the display. User configurable for adapting to 
other printers. Comes set -up for Epson MX80 with Graflex. Up to 10 imbedded printer control 
commands. Compensates for double width printing. Includes normal line width, page numbering, 
margin* indent, paragraph, space, vertical skip lines, page length, centering, fill, justification, etc. Use 
with PAT or any other text editor. The ONLY stand alone text processor for the 68XXX OS-9, that 
we have seen. And at a very LOW PRICE! Order from: S. E. MEDIA - see catalog this issue. 

Southeast East Media 

5900 Cassandra Smith Rd 

Hixson, Tn. 37343 

Telephone (615) 842-4600 

FAX (615) 842-7990 

U.S.A. $4.50 

CANADA $7.50 

FOREIGN $25.00 


August /September'89 

68 Micro Journal 


OS -9 User Notes 

By: Peter Dibble 

The publishers ol 68* Micro Journal are proud lo make available the 
prifcalion of Peter Dfcbfes 


Infcrmaiion for the BEGINNER to the PRO, Regular or CoCo OS9 

Using OS9 

OS9 STANDARDS, Generating a New Bootstrap. Building anew System 
Disk. 069 Users Group, etc 

Programming Languages 

Assembfy Language Pfograms and fnlerladng; Basic09, C, Pascal, and 
Cobol reviews, programs, and uses; etc. 

Disks tod ude 

No typing all the Source Listings in. Souice Code and, where applicable, as- 
sembled or compiled Operating Programs. The Source and the Discussions 
in the Columns can be used *as fedoras a "Start ^^ 
OWN more powerfel Programs. Programs sometimes use multiple Lan- 
guages such as a snort Assertory Language Routine tar reatfng a Directory, 
which is then 'pped* to a Bas»c09 Routine lor output formatting, eta 

BOOK 59.95 

Typeset — w7 Source Listings 

(3-Hole Punched; 8x11) 

Deluxe Binder $5.50 

AJI Source Listings on Disk 

1-8" SS.SD Disk $14.95 
2-5' SS,SD Disks $24.95 


By: Ronald Anderson 

The publishers of 68 MICRO JOURNAL are proud lo make available the pub- 
lication of Ron Andersons FLEX USER NOTES, in book form. This popular 
monthly column has been a regular lealure in 66' MICRO JOURNAL SINCE 
1979. It has earned the respect of thousands of 68 MICRO JOURNAL readers 
over the years. In tact, Ron's column has been described as the 'Bbte' for 

most needed and popular 68XX book available. Over the years Rons column 
has been one of the most popular in 68 MICRO JOURNAL. And of course 68 
MICRO JOURNAL is the most popular 66XX magazine published. 

Listed below are a few ol the TEXT files included in the book and on 
diskette. Al TEXT files in the book are on the disks. 

L0G0C1 File load program » offcei memory ASM PIC 

MEMOVES.C1 Memory move program - ASM PIC 

DUMP.Ct Printer dump program - uses LOGO * ASM PIC 

SUBTEST Cl StiulaiOA of 6800 code id 6609. show dflerenas - ASM 

TERMEM C2 Modem input id disk (or other port *pul Id disk) • ASM 

M.C2 (Xflput aftok) modem {or another port) - ASM 

PRINT.C3 Parallel (enhanced) printer drive/ - ASM 

M0DEM.C2 TTLoulpui to CRT and modem (or other pon) ASM 

SCIPKG.C1 Scientific math routines . PASCAL 

U.C4 Mirw-monrtor. disk resident, many usefuri functions • ASM 

PRINT.C4 Parallel pnnter dmrer. witiout Pf LAG - ASM 

SET.C5 Set primer modes - ASM 

SETBAS1 C5 Set pnnier modes - A BASIC 

Note: .Cl, ,C2. elc.=Chapter \, Chapter 2, etc. 

" Over 30 TEXT files induded is ASM (as$embter).PASCAL- 
PIC (position independent code ) TSC BASlC-C, etc. 

Book only: $7.95* $2.50 S/H 

With disk: 5' $20.90 ♦ $2.50 S/H 
With disk: 8' $22,90* $2.50 S/H 

Shipping & Handling $3.50 per Book, $2.50 per Disk set 

Foreign Order t Add $4.50 Surface Mall 

or &7.00 Air Mall 

H paying by check * Please allow 4*6 weeks delivery 

* All Currency In U.S. Dollars 

Continually Updated In 68 Micro Journal Monthly 

Computer Publishing Inc. 

5900 Cassandra Smith Rd. 

Hlzson. TN 37343 

Telephone (615) 842-4601 

RiX a t tmdtanaHi ol TefooJ Spatra CorwAaro 
«T Mcro Jcun* « 4 tnrtamajfc 4 Carp*** Plfcfa/*^ Int 

FAX (615) 842-7990 

68 Mcro Journal 

August /Septembef'39 


68 f Micro Journal 
Reader Service Disks 

Disk- I Filesort, Minicat, Mmi»opy,Mmifros, ••Lifetime, ••Poetry. ••Foodlist, ••Diet. 

Disk- 2 Diskedit w/ insL& fixes, Piimc, - Pnnod. ••Snoopy, • •Football, ••Hexpawn." lifetime. 

Disk- 3 Cbug09, Sect. Scc2, Find, Tablc2. lmexi, Diik-cxp, •Disksave. 

Disk- 4 Mailing Piogram, •Finddai, 'Change, •Tcstdisk, 


Disk- 6 ••Purchase Order Index (Disk lile indx). 

Disk* 7 Linking Loader, Kload, Harkrwss. 

Disk-8 Cnesi, Unpber (May 82). 

Disk- 9 Daiecopy, Dukfu9 (Aug 82). 

Disk- 10 Home Accounting (July 82). 

Disk- 1 1 Dissembler (June 84). 

Disk- 12 Modem68 (May 84). 

Disk. 13 Mnitmr68, Testmf68, > Cleanup.»Dska]ign,Hc]p,Date.TxL 

Disk- 14 •Init. •Test. •Terminal. •Find. •Diskedit. Inil.Lib. 

Disk- 15 Modem + Updates (Doc. 84 Gilchrist) to Modem (April 84 Commo). 

Disk- 16 Copy.Txi, Copy .Doc, Cal.Txi. Cat.Doc, 

Disk-17 Maicli Utility. RATBAS. A Basic Pieprocessor. 

Disk- 18 Parse Mod, Sizc.Cmd (ScpL 85 Armstrong),CMDCODE. CMD.Tm (Sept. 85 Spray), 

Disk- 19 Clock, Dale, Copy, Cat, PDELAsm & Doc., Errois.Sys, Do. Log. Asm & Doc. 

Disk.20 UNIX Uke Tools (July & Sept. 85 Taylor & Gilchrist). Dragon. C. Grep.C. LS.C. FDUMP.C. 

Disk'21 Utilities & Games - Date, Life, Madness, Touch, Goblin. Starshot, &. 15 more. 

Dlsk-22 Read CPM & Non-FLEX Disks. Fraser May 1984. 

Dlsk-23 ISAM, Indexed Sequential file Accessing Methods, Condon Nov. 85. Extensible Table Driven. Language Recognition Utility. Anderson Mar86. 

Disk 24 68' Micro Journal Index of Articles & Bit Bucket Items from 1979 - 1985. John Current. 

Disk- 25 KERM1T for FLEX derived from Hie UNIX vcr. Burg Feb. 1986. (2)-5 M Disks or (l)-8 tf Disk. 

Dlsk-26 Compacta UniBoard review, code & diagram. Hurlison March '86. 


Disk- 28 CT-82 Emulator, bit mapped 

Dlsk-29 ••Star Trek 

Dlsk-30 Simple Winchester, Dec, '86 Green. 

Disk-3i ••• fccacTWrite MS/PC D#S (SK*DOS) 

Disk-32 Hcir-UNIX Type upgrade - Feb .87 

Disk 33 Build the GT-4 Terminal ♦ Nov. 87 Joseph Condon. 

Disk-34 FLEX 6809 Diagnostics, Disk Drive Test. ROM Test. RAM Test - Apr. 89Koipi. 

Disk.35 DO A FLEX-09 Batch FUe Processor - Oct. 88 - Dave Howland 

Disk- 36 Add Graphics To Your SBC - Nov. 88 - Joseph Condon 

Dlsk-37 Minix for the PT68K-2 - Junetfuly 89 - J, GaiyMills 

This is a reader service ONLY! No Warramy is offered or implied, they arc as received by 68' Micro Journal* and arc for reader 
convenience ONLY (some MAY include fixes or palchcs). Also 6800 and 6809 programs arc mixed, as each is fairly simple 
(mosily) lo convert to ihc olhcr. Software is available to cross-assemble alt. 

♦ Dcnoics 6800 - ** Dcnoics BASIC 
*** Denolcs 68000 - 6809 no indicator. 

8" disk $19.50 
5" disk $16.95 

Shipping & Handling -U.S.A. Add: - $3.50 
Overseas add: $4.50 Surface - S7.00 Airmail 


5900 Cassandra Smith Rd. 
Hixson, TN 37343 

(615) 842-4600 
FAX (615) 842-7990 

62 August /September^ 68 Micro Journal 



!!! Subscribe Now !!! 


j&r*5 Toll Free Subscription Line 1-800 669 6809 


Bill My: □ Mastercard □ VISA 
Card U Exp. Daie_ 

For I Year 

2 Years 

3 Years 

Enclosed: $_ 





My Computer is: 

My Operating System is: 

Subscription Rates 
U.S.A.: 1 Year $24.50, 2 Years $42.50, 3 Years $64.50 
♦Foreign Surface: Add $12.00 per Year to USA Price. 
♦Foreign Airmail: Add $48.00 per Year to USA Price. 
♦Canada & Mexico: Add $9.50 per Year to USA Price. 
♦U.S. Currency Cash or Check Drawn on a USA Bank ! 

68' Micro Journal 

5900 Cassandra Smith Rd. 

POB 849 

Hixson.TN 37343 

Toll Free Subscription Line 

1-800 669 6809 

FAX (615) 842-7990 


68 Mcro Journal 

August /September' 89 





The PT68K2 is Available in a Variety of Formats 
From Basic Kits to Completely Assembled Systems 

BASIC KIT (8 MHZ) * Board. 68000, 
Components $200 

PACKAGE DEAL - Complete Kit with 
Board 68000 10 MHZ. SK'DOS, 512K 
RAM. and all Necessary Parts $575 


Completely Tested, 1024K RAM. 

and CABLES Add $295 


"SK'DOS ft a Tf«Jamarti of 


"OS9 ft a Tradrnafr <* Mkxmw 



MC68000 Processor. 8 MHZ Clock (optional 

10,12,5 MHZ) 

512K or 1024K of DRAM (no wail states) 


32K.64K or 128K of EPROM 

Four RS 232 Serial Ports 

Floppy disk controller will control up to four 

5 1/4", 40 or 80 track. 

Clock with on -board battery. 

2 - 8 bit Parallel Ports 

Board can be mounted in an IBM type PC/ 

XT cabinet and has a power connector to 

match the IBM type power supply. 

Expansion ports - 6 IBM PC/XT compatible 

I/O polls The HUMBUG 7 " monitor supports 

monochrome and/or color adaptor cards 

and Western Digital Winchester interface 



1710 Cumberland Point Dr., Suite 8 

Marietta, Georgia 30067 



Send For Catalogue 
For Complete Information On All Products 




Heavy Duty Power Supplies 


For A limited time our HEAVY DUTY SWITCHING POWER SUPPLY. These are 8RAND NEW units. Note that these 
prices are tess than 1/4 the normal price for these high quality units. 


Make: Boschert 

Size: 10.5x5 x 2.5 inches 

Including heavy mounting bracket and hcaismk. 

Rating: in 1 10/220 volts ac (strap change) Out: 130 watls 

Output: +5v - 10 amps 
+ 12v - 4.0 amps 
+12v - 2.0 amps 
-12v-0.5 amps 

Mating Connector: Terminal strip 

Load Reaction: Automatic short circuit recovery 

SPECIAL: $59.95 each 

2 or more $49.95 each 

Add: S7.S0 each S/l i 




Make: Boschert 
Size: 10.75 x 6.2 x 2.25 inches 

Rating: 110/220 ac (strap change) Out: St waits 

Outputs: +5v - 8.0 amps 
+ 12v - 2.4 amps 
+ 12v - 2.4 amps 
+12v - 2.1 amps 
-12v - 0.4 amps 

Mating Connectors: Molex 

Load Reaction: Automatic shod circuit rccovcty 

SPECIAL: $49.95 each 

2 or more $39.95 each 

Add: $7.50 S/H each 

J V 


5900 Cassandra Smith Rd., Hixson, Tn. 37343 Telephone 615 842-4600 Telex 510 600-6630 Fax (61S)842-7990 



August /September'89 

68 Mcro Journal 

Realtime & Multiuser/Multitasking 

covers the whole spectrum for applications with 
the 680xx microprocessor family 

Personal OS-9 

Professional OS-9: 

Kernel, Pipeman I SCF 


OS-9 Modules. 


OS-9 is an approved, high performance operating sys- 
tem featuring a complete set of services and software: 

• Languages: 

• Support Services: 

• Technical Services: 

• Software Develop- 
ment Support: 

• Complete Applica- 
tion Software Pack- 

la-2, ADA 

Technical Hotline Support worldwide, 
CompuServe, Training Seminars, User's 

Installation Support, Application Support, 
Customisation Services 
Cross-Software Development 
Packages: Cross-Compilers, UNIBRIDGE- 
UNIX-Cross-Development Package 
Networking, TCP/IP, Data Base Manage* 
ment Systems, Graphics Kernel 
System .... 

1 Cro*9 Compiler under VAX/VMS 

OS-9 Features 

• Real-Time Executive 

• Multi-User, Multi-Tasking 

• ROMable 

• UNIX-like Shell Interface 

• Interprocess Communications 

• Modularity 

OS-9 includes 

• Memory Management 

• I/O Management 

• File Management 

• Process Management 

• Complete Interrupt Services 

— "->*#•••>•¥*/ JM-iM I WW ED I LDI E A I I Dr. Rudolf Kell GmbH Phone 06221/862091 

fn&SWWW(JE*<*~ Film rn Crn Gerhart-Hauptmann-Str. 30 Telex 461 166 kerl d 

1 /[ ■ LJLJL^J LJI ial II i D~GQ15 Dnsftanhftim T«lnfa* Dfi221/ftfilQ5, 


authorized Distributor 

Software Elektronik Datentechnik 

Telefax 06221/861954